13 Jul 2012 2:12 PM #1
Initialize EditorGridPanel with blank rows
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?
13 Jul 2012 5:03 PM #2
Have you tried store.suspectEvents(); add items; store.resumeEvents()
16 Jul 2012 7:57 AM #3
I gave it a whirl, but it seems a little buggy.
store.suspendEvents(false); //queueSuspended set ti false to prevent events from queing //... code to add records ... store.resumeEvents();