Forum
09:54
11/03/2010
Hi, tony, I found a problem in 3.6
I just do such things:
jQuery("#list2").delRowData(rowid);
//this remove the row successfully.
var grid2 = jQuery("#list2");
var currentnum =grid2.getGridParam("records");
for(var i=1;i<=currentnum;i++)
{
var kpiid = grid2.getRowData(i)["kpiid"];
alert(kpiid);
}
if the jQuery("#list2").delRowData(rowid) delete the last row of the grid, everything is ok. but if the rowid be deleted is in the middle or first of the rows, the alert(kpiid) will give "undefined".
For example, there are 5 records in the grid, the frist rows's kpiid cell is '247', the second row's kpiid cell is '258'. If i delete the first row by delRowData, yes, it seems to be remove from the grid. But in the for {alert()}, it will show 'undefined' at first circulation
, and show '258' in the 2nd circulation. Just like the first row STILL point to the origin row(247), which should have been removed just now. It seems that the grid not really remove it, but set it's data to undefined, but just let it not be seen from outside.
yours,
Ivan
10:45
Moderators
30/10/2007
Hello,
Thanks, but I think you mixed a lot of things.
First you do delete using rowid and then you use a counter to get the data and not id.
In order to test use this:
var currentnum =grid2.getDataIDs();
for(var i=0;i<currentnum.length;i++)
{
var kpiid = grid2.getRowData(currentnum[i]);
}
Let me know if you have undefined
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.
10:25
19/04/2012
omrcm said:
Hi Tony,
I have de same problem and I use this function to fixed but the fire bug give me this error ;
"getDataIDs is not a function"
I use jQgrid 3.7.2 .
I delete one row from the list with the method ;
jQuery("#gridName").jqGrid('delRowData',rowId);
I have fixed the problem.
this whas my first code ;
var gridCount = jQuery("#gridName").jqGrid('getGridParam', 'records');
for ( i=0; i <gridCount ; i++){
}
I change it with this ;
var ids = jQuery("#gridName").jqGrid('getDataIDs');
for ( i=0; i <ids.length; i++){
}
Most Users Ever Online: 715
Currently Online:
49 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