Forum


14:09

16/12/2008

Hi,
I'm really enjoying the 3.5Alpha release - the theming support is huge!
I am having some trouble getting afterInsertRow to execute. It works as expected in another project using jqGrid 3.4, but in a new 3.5 project, it simply doesn't execute. At first I was trying to set row color and thought it was a conflict in the theming css, but even executing an alert() simply does nothing (both FF3 and IE7).
Here is part of the code...I am using a grid as a subgrid, but the afterInsertRow applies only to the main grid, and it works fine in my version 3.4 project which also uses grids as subgrids.
Any ideas?
jQuery(document).ready(function(){
jQuery("#mylinks_grid_table").jqGrid({
afterInsertRow: function(rowid,rData) {
alert('hi');
// if("x" == "x") {
$("#"+rowid, "#mylinks_grid_table").css({color:'red'});
// }
},
caption: 'My Family\\'s Links',
colModel :[
{name:'id', index:'id', width:40, align:'center',editable:false,editoptions:{readonly:true,size:10},hidden:true},
{name:'flag', index:'flag', width:70, align:'center',editable:false,editoptions:{readonly:true},hidden:false},
{name:'added', index:'added', width: 70, editable:false, sortable:true},
{name:'share', index:'share', width: 70, align:'center',editable:true,edittype:"checkbox",editoptions:{value:"yes:no"}},
{name:'name', index:'name', width: 200, editable:true,editoptions:{size:45}},
{name:'link', index:'link', width: 300, editable:true,editoptions:{size:45}, formatter:'link'}
],
colNames:['ID','Flag','Added','Share','Name','Link'],
datatype: 'xml',
forceFit: false,
height: 572,
imgpath: gridimgpath,
mtype: 'GET',
21:33

16/12/2008

I figured this problem out, but I'm not sure if it is the right thing to do.
I made a small change in jquery.base.js (again, version 3.5Alpha), I changed row 800:
if(afterInsRow===true) {ts.p.afterInsertRow(row.id,rd,this);}
to
if(afterInsRow = true) {ts.p.afterInsertRow(row.id,rd,this);}
afterInserRow executes now, where it never would before. I don't know if this breaks anything anywhere else?
Thanks,
Adam
03:59

Moderators
30/10/2007

Hello,
Thank you for this. It is a bug when a xml datatype is used in 3.5 only
The right correction is:
if(afterInsRow) {ts.p.afterInsertRow(row.id,rd,this);}
Thanks.
Best Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
110 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