after Save

11 views
Skip to first unread message

infringer

unread,
Oct 22, 2010, 9:52:24 AM10/22/10
to MyTableGrid
I just discovered that after a save is performed. The table's
modifiedRows, deletedRows and newRowsAdded are not reset.

So each time a save is performed after that, those same rows get sent
for processing again. For "modifiedRows" i guess this is ok, but not
how it should act.

For newRowsAdded though, it could wreak some havoc on particular
tables, inserting the same row multiple times, if someone is
performing multiple saves.

My suggestion:
in tablegrid.js there is a function "clear" that is not being used,
that blanks the modifiedRows array.
Add the following 2 lines to the clear function.
this.deletedRows = [];
this.newRowsAdded = [];

then inside the render function, where the "save" button processing is
performed.
right after the if statement for "if (self.options.toolbar.onSave)
{ .... }" add:
self.clear();

-David

Pablo Aravena

unread,
Oct 22, 2010, 9:55:08 AM10/22/10
to mytab...@googlegroups.com
Excellent friend

I will add that fix for next release

Thanks

Pablo

> --
> You received this message because you are subscribed to the Google Groups "MyTableGrid" group.
> To post to this group, send email to mytab...@googlegroups.com.
> To unsubscribe from this group, send email to mytablegrid...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mytablegrid?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages