PDA

View Full Version : RESTful Grid problem



ladro1987
16 Apr 2011, 2:26 AM
Hi all!!
I have used this grid:
http://dev.sencha.com/deploy/dev/examples/restful/restful.html

All Right but I was wondering if there is a method for reload the store when i click on "cancel".

The problem is that remains the record also if I don't save it!

Thanks!!
Roberto

varunach
17 Apr 2011, 8:52 PM
listen for the event 'canceledit' on the editor plugin and do store.remove(record);

ladro1987
18 Apr 2011, 12:35 AM
Thank You for the responce!! :-)

I add this listen event at the plugin:



'canceledit': function(roweditor, changes, record, rowIndex) {store.remove(record);},

and don't work.

In this moment work with this solution:


'canceledit': function() {store.reload();},


Why the "store.remove" don't work?
Thanks again for the responce! :)

varunach
18 Apr 2011, 2:29 AM
You got the function parameters wrong. Use this.

'canceledit' : {
fn : function(roweditor, forced) {
if (roweditor.record) {
if (roweditor.record.phantom === true) {
appointmentGridStore
.remove(roweditor.record);
}
}
}
}
B)

ladro1987
23 Apr 2011, 7:42 AM
Now work perfectly!!!!! I'm a ***** and the solution were very simple!!=D>:>

Thank you!!:)