Forum


07:34

29/07/2008

Hello Tony,
I'm trying to delete the rows selected by the user.
However, I've tryied almost all combinations ofthe following loop, without achieving that after it "getGridParam('selarrrow')" eguals zero.
How should I do it ?
Here my code ...
Thanks in advance
var filas = jQuery("#tabla").getGridParam('selarrrow'); if (filas == null) { return false; } for(var i=filas.length-1; i>=0; i--) { alert(filas+'(length='+filas.length+') current: '+filas[i]); jQuery("#tabla").delRowData(filas[i]); jQuery("#tabla").setSelection(filas[i]); } alert(jQuery("#tabla").getGridParam('selarrrow'));
07:47

Moderators
30/10/2007

Please tell me what is wrong here - you can not catch the selected rows or you can not delete them?
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.
01:09

29/07/2008

I have a custom button, which status toggles on (un)selecting a rows. Therefor, if the user intends to delete some rows, the selection should remain empty in the end.
But the fact is that if I first delete the rows, then I can't unselect them, and they stay available in the selarrow. (I should have mention that I use multiselect)
On the other side, if I first unselect the rows, they are correctly removed from the selarrow, which makes deletion impossible …
A workaround is to copy the array while unselecting the rows, and to loop another time for deletion…
var filas = jQuery("#tabla").getGridParam('selarrrow'); if (filas == null) { return false; } var filas_delete = []; var filas_select = filas; for(var i=filas_select.length-1; i>=0; i–) { filas_delete[i] = filas_select[i]; alert(filas_select+'(length='+filas_select.length+') current: '+filas_select[i]+ '\\n my new array: '+filas_delete ); jQuery(”#tabla”).setSelection(filas_select[i]); } for(var i=filas_delete.length-1; i>=0; i–) { alert(filas_delete+'(length='+filas_delete.length+') current: '+filas_delete[i]); jQuery(”#tabla”).delRowData(filas_delete[i]); }
01:18

29/07/2008

Hello Tony,
I'm so sorry : i just seen the resetSelection() function ....
Then my problem is just solved : the following code makes all the work :
var filas = jQuery("#tabla").getGridParam('selarrrow'); if (filas == null) { return false; } for(var i=filas.length-1; i>=0; i--) { jQuery("#tabla").delRowData(filas[i]); } jQuery("#tabla").resetSelection();
Thank you very much for this plugin and for you atention !
greetings !
Most Users Ever Online: 715
Currently Online:
63 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