I an using jqGrid, and I'm having a heck of a time inserting a new row in a specific location. I have the rowId, but when I make a call to determine what the position (the index of the row) I get a null back. I'm working with the table:
var grid = jQuery("#myTable");
grid.jqGrid({
datatype: "local",
colNames:['id','Type', 'Name', 'Total','In','Out'],
colModel:[
{ name: 'id', index: 'id', hidden: true, align:"center"},
{name:'type',index:'type', width:10, sortable:true, align:"center"},
{name:'name',index:'name', width:40, sortable:true, align:"center"},
{name:'total',index:'total', width: 10, sortable:false, align:"center"},
{name:'in',index:'in', width:10, sortable:true, align:"center"},
{name:'out',index:'out', width:10, sortable:true, align:"center"}
],
width: "600",
height: "900"
});
But when I call:
var dataIds = jQuery("#myTable").getDataIDs();
I get back the following:
Level 3.xpusdscdw,Level 3.scoach3,Level 3.xpusdscvs,Level 3.xpusdscah,Level 3.xpusdsctotem,Level 3.xpusdscsc
But when I try to get the row index of any of those, the result comes back null. This is what I'm trying to do:
var position = jQuery("#myTable").getInd(rowId,false);
alert("Position is: "+position+" for "+rowId);
And then I check and see what I got back (with the alert), I see this:
Position is: false for Level 03.xpusdscvs
?
What gives? getInd is supposed to return the row index of the rowId when you pass in false as the second parameter. A little help?
Thanks