Forum



00:31

13/04/2010

*********************
edit: Figured it out, in the code that isn't a sample im using some server side
stuff to determine whether nor not this col gets added, I had forgotten to add
an empty <cell> in the xml that is my grid data, to compensate for the additional
column in the grid.
*********************
Hey guys,
I am trying to add a button into my grid that I am going to add a custom .click to…
I've got the button showing up, but the widths of my cells are now off a bit.
Below is basically what im doing.
Attached is a screenshot where you can see what I am talking about.
Anyone know what I may be doing wrong?
EDIT: It seems that the values in my "leano" column are being replaced by my "Approve" buttons…
Is there an error in my usage of setRowData ?
jQuery("#mygrid").jqGrid('setRowData',ids[i],{act:be});
You may need to view the image in a new window or tab to view it in its normal dimensions.
jQuery(document).ready(function(){
jQuery("#mygrid").jqGrid({
url:'<?php $html->url('/controller/action/param'); ?>,
mtype:'GET',
datatype:'xml',
caption:'This grid blah blah blah…',
pager:'#pagered',
sortname:'leanob',
viewrecords:true,
multiselect:false,
autowidth: true,
height:400,
colNames:[
'Action',
...
]
colModel:[
{name:'act',index:'act',width:60:sortable:false,editable:false},
...
]
gridComplete: function(){
var ids = jQuery("#mygrid").jqGrid('getDataIDs');
for(var i = 0, i < ids.length; i++){
var cl = ids[i];
be = "<input style='height:22px:width:40px;' type='button' value='Approve' onclick="jQuery('#mygrid').editRow('"+cl+"');" />";
jQuery("#mygrid").jqGrid('setRowData',ids[i],{act:be});
}
}
…
});
});
Most Users Ever Online: 715
Currently Online:
66 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66