Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
jquery grid getRowData has problem after delRowData
12/08/2010
09:54
Avatar
ivanchain
Member
Members
Forum Posts: 55
Member Since:
11/03/2010
sp_UserOfflineSmall Offline

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

12/08/2010
10:45
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

12/08/2010
12:00
Avatar
ivanchain
Member
Members
Forum Posts: 55
Member Since:
11/03/2010
sp_UserOfflineSmall Offline

thank you tony, but:

how could var kpiid = grid2.getRowData(currentnum[i]);  get out the value of kpiid??

you mean grid2.getRowData(currentnum[i])["kpiid"]; ?

yours,

Ivan

12/08/2010
12:05
Avatar
ivanchain
Member
Members
Forum Posts: 55
Member Since:
11/03/2010
sp_UserOfflineSmall Offline

Tony, I have tried the solution, yes, the undefined is gone way.

thank you so much!

yours,

Ivan

19/04/2012
09:55
Avatar
omrcm
New Member
Members
Forum Posts: 2
Member Since:
19/04/2012
sp_UserOfflineSmall Offline

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);

19/04/2012
10:25
Avatar
omrcm
New Member
Members
Forum Posts: 2
Member Since:
19/04/2012
sp_UserOfflineSmall Offline

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++){

}

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
65 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information