Forum


02:40

13/06/2009

Hi,
I've recently upgraded from 3.6 to 3.7 (3.7.2) and a couple of things that seemed ok previously are now doing odd things.
I have a simple grid that is filled from local data and as I wish the rowids to reflect to index of the array I'm filling from I start it at 0. I've done a very simple demos at
http://www.thekmz.co.uk/GEPlug.....7_3.6.html – for the 3.6 version
http://www.thekmz.co.uk/GEPlug..... – for the 3.7 version
and put some console.logs in there.
When the grid initially loads the 2 records get added and afterInsertRow is called on each one – outputting to the console the rowids 0 & 1 (as expected). This happens in both 3.6 & 3.7.
However if in the 3.7 version I sort either column the afterInsertRow event is fired twice again – one for each row but now rowids 1 & 2 (not expected). In 3.6 it's ok.
How do I ensure that the rows keep the ids of 0 & 1 and how do I prevent the afterInsertRow from firing when I do a sort.
I hope I'm not doing something too stupid but I just can't see what's wrong.
Thanks
Romyn
11:14

Moderators
30/10/2007

Hello,
When used this way in 3.7 you should configure your localReader in order to know which is the id
http://www.trirand.com/jqgridw.....array_data
But the easy way is to set key:true in the idx column.
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.
15:00

13/06/2009

Thanks Tony,
Adding key=true to the idx column has fixed the rowid issue out 🙂
However the afterInsertRow still fires for each row when the grid is sorted - is there a way to prevent that? It's not urgent as I can just test within that function whether the rowid is >= to the length of the array I'm filling the grid from - if it is then it's a new row ... if not then it's already there - but it would be nice if that it didn't fire at all on sorting. I suspect there must be a good reason for this happening though so testing is probably the route I should take.
Thanks again
Romyn
Most Users Ever Online: 715
Currently Online:
54 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