PDA

View Full Version : Grid With rowEditing, need to submit only few column data



AtulDawkhare
15 Dec 2011, 5:02 AM
Hi all,
I have Grid, in which I have implemented 'rowEditing'. And Now I am able to edit the row.
e.g. If my Gird has 5 columns , then using proxy api, 'update' I get all 5 column value.

So my query is, it is possible to get only 4 column's data ONLY instead of all 5 columns using rowediting ?
Or for this i have to go for cell editing plugin.

Please suggest if I am wrong anywhere.

mitchellsimoens
15 Dec 2011, 2:39 PM
Do you have a writer specified on your proxy? If so you can use the writeAllFields : false to only send the modified fields.

AtulDawkhare
15 Dec 2011, 10:38 PM
Thanks a lot, this is what I was looking for.
One More question Can we get only currently edited row value at the server side?
e.g. If there are 10 records in the current page, and if I edit 1st then only 1 records get submitted to server, but if I edit 2nd record then both first and second record gets submitted to server.

I want only currently edited row in the store.

Also If i write "store.load();" , then the whole page gets refresh, which I don't think is the correct way.



grid.on('edit', function(editor, e)
{
editor.store.sync();
store.load();
}


Please suggest me.

mitchellsimoens
16 Dec 2011, 5:46 AM
If you set autoSync to true on the store, it *should* automatically sync when a record is changed. Call store.load() will refresh the page.

AtulDawkhare
16 Dec 2011, 11:47 PM
Hi there,

Thank you for your reply.

yes in store I have both set to true


autoSave: true, autoSync:true


and I am getting edited value to the server side.

Let me explain my doubt once again.
I have a Grid having 10 rows in a current page. Now when I edit 1st record it send server only first record.
Something like



{"Project_name":" Atuls11ss","id":"3022"}


But when I edit the second record, I get json string something like


[{"Project_name":" Atuls11ss","id":"3022"},{"Project_name":" ertertaaadd","id":"3288"}]


That mean on server side I get both records 1st and second. It is not sending me ONLY latest edited record.

So I want only the following Json after editing 2nd record.


{"Project_name":" ertertaaadd","id":"3288"}


Hope I am able to explain very well.

Let me know how can achieve this? Please correct me if I am expecting something wrong here.