This is what i use to remove all the rows from the grid

                        var i;
                        for (i=0;i<num;i++){
                                grid.removeItemAt(0);
                        }


On 1/19/06, Peter van der Kamp <[EMAIL PROTECTED]> wrote:
> Hello James,
>
> > My application displays information in a grid.  My application allows
> > users to delete selected row(s) from the grid.  I can get this to work
> >  just fine, but the selection always pops back to the first row in the
> >  grid.  My code does the following (a method defined in my grid
> > instance):
> >
> > <method name="deleteSelectedItem">
> >  var selection = getSelection();
> >  selectNext();
> >    selection.deleteNode();
> > </method>
> >
> > My hope was that by saving the selection and then selecting next I
> > could  delete the selected item and have the highlight be in the right
> > place.   This didn't happen, however.  Can someone help me with the
> > right way to do  this?
>
> Here's the piece of code I use for the same purpose. This works fine
> for me. resultGrid is the value of the attribute id of the grid.
>
> var sel = resultGrid.getSelection();
> for (i=0; i<sel.length; i++) {
>     var remove = resultGrid.getIndexForItem(sel[i]);
>     resultGrid.removeItemAt(remove);
> }
>
> Peter van der Kamp
>
> _______________________________________________
> Laszlo-user mailing list
> [email protected]
> http://www.openlaszlo.org/mailman/listinfo/laszlo-user
>

_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to