-
13 Jul 2012 2:12 PM #1
Initialize EditorGridPanel with blank rows
Initialize EditorGridPanel with blank rows
Hi,
I need to populate a Grid with blank rows. I can do this, but because the store has autosave set to true and is restful, a PUT request gets fired for each blank row that I insert. This is not what I want - I want these blank rows to just live in the UI until someone actually enters something into them - only then do I want to send a PUT to the server.
So I tried blocking the save of the blank rows in the store's beforesave event. That works. But when I enter data into one of the rows, instead of firing off a PUT for that one row, ExtJS fires off a PUT for all of the rows again.
With a restful, autosaving store, is it possible to have these "UI only" rows - and produce a PUT request only for one that actually gets edited?
Thanks
-
13 Jul 2012 5:03 PM #2
Have you tried store.suspectEvents(); add items; store.resumeEvents()
Scott.
-
16 Jul 2012 7:57 AM #3
Thanks
I gave it a whirl, but it seems a little buggy.
I did...
...but when I pass a false queueSuspended various things start breaking - like adding additional rows produces "Error: Ext.fly(this.getRow(row)) is null" errors. This does not happen when I pass true for queueSuspended, but then that's not the behavior I need....Code:store.suspendEvents(false); //queueSuspended set ti false to prevent events from queing //... code to add records ... store.resumeEvents();


Reply With Quote