Forum
Topic RSS
02:58
21/06/2010
OfflineHi,
I have been working with jqgrid for a few weeks, and it is a great system. I got my application working, but this one thing keeps driving me crazy
Whenever I hit the delete row button on the pager, I get the warning dialog box, and then firebug kicks in with a javascript error:
Line 362 b(":input:visible", a.w)[0] is undefined
I have tried to bug hunt, and have made a super simple grid, but no matter what I do firebug stops with this error. My super simple grid is below:
$(document).ready(function(){
jQuery("#list").jqGrid({
url:'db/get_jeger.php?nd='+new Date().getTime(),
datatype: "json",
colNames:['Jeger ID' ,'Navn'],
colModel :[
{name:'jeger_id', index:'jeger_id', align:'center',width:100,editable:true},
{name:'navn', index:'navn', align:'left', width:170,editable:true}
],
pager: '#pagerId',
sortname: 'jeger_id',
sortorder: 'asc',
editurl: "db/edit_jeger.php",
caption: 'Alle registrerte jegere'
});
jQuery("#list").jqGrid('navGrid','#pagerId',{},{},{},{},{});
});
I would really appreciate it if anyone can help me with some info about this error message.
Thanks a lot!
-Kyle
10:37
Moderators
30/10/2007
OfflineHello,
How look your head section?
Which modules do you have downloaded?
Be a sure that you use the grid CSS fiele from the production dir and not from development.
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.
16:53
02/07/2010
OfflineAha, I was getting the same thing, and I worked out why, for me.
In my delete handler I was doing
beforeShowForm: function()
{
$('#mygrid').jqGrid('restoreRow',lastedit);
}
i.e. get out of edit mode before we delete. Unfortunately, I wasn't checking for undefined, and not having entered edit mode yet, that's what it was, hence the above error. Silly me.
18:49
02/07/2010
OfflineArgh, now I'm getting it again, same as Kyle.
I downloaded all the modules, and the css is correct, using latest 3.7.2.
What does
b(":input:visible", a.w)[0] is undefined
mean? i.e. what is it looking for that is failing?
Even a simple array grid fails if I select a row and try to delete.
var mydata = [ {id:"1",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"}, {id:"2",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"}, {id:"3",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}, {id:"4",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"}, {id:"5",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"}, {id:"6",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}, {id:"7",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"}, {id:"8",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"}, {id:"9",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"} ];
$("#mygrid").jqGrid({ datatype: "local", height: 250, pager: '#mypager',
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[ {name:'id',index:'id', width:60, sorttype:"int"},
{name:'invdate',index:'invdate', width:90, sorttype:"date"},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right",sorttype:"float"},
{name:'tax',index:'tax', width:80, align:"right",sorttype:"float"},
{name:'total',index:'total', width:80,align:"right",sorttype:"float"},
{name:'note',index:'note', width:150, sortable:false} ],
caption: "Manipulating Array Data" });
for(var i=0;i<=mydata.length;i++) jQuery("#mygrid").jqGrid('addRowData',i+1,mydata[i]);
$('#mygrid').jqGrid('navGrid','#mypager',{});
I probably have got something wrong in my setup. But I have no clue!
12:47
02/07/2010
OfflineLooks likes this is a known issue to do with jqModal:
http://stackoverflow.com/quest.....ew-content
Basically:
jqModal.js line 64:
f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(_){}}
i.e. tries to focus on first visible input field, which will fail, and throw up an error in firebug. Although I only see this sometimes!
It can work, then refresh on same page and then it fails. Very odd.
Fixed code in jquery.jqGrid.min.js thus:
s=function(a){var vis=b(":input:visible",a.w); if (vis.length>0) try{vis[0].focus()}catch(f){}}
i.e. I check to see there are any visible elements first.
Most Users Ever Online: 994
Currently Online:
21 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
Log In
Home