PDA

View Full Version : Updating single record of the store



dev_java
25 Aug 2010, 12:10 AM
Hi,

I have faced with a scenario, where i have to update just the selected row of the store.

I have 5 records in a store, and the store is loaded to a grid panel. In the grid panel, i have a check box. On selection of check box, i will be doing DB interaction. On success, i have to update the particular row of the grid.

following is the request call for updating the DB from mouseDown event of check box. 'storeGrid' is the name of store which i am using.



function updateDetails(record){

Ext.Ajax.request({
url: '../home/updateDetails.htm',
method: 'POST',
params: {

id:record.get('id')
},
success: function(result, request){
var jsonData = Ext.util.JSON.decode(result.responseText);
var msg = jsonData.data.msg;
alert('success from update');
//storeGrid.load();
},
failure: function(form, action){


} ,
scope: this,

});


On success, i have to store the value msg in the store for that particular row..

Can any one help me on this..
Thanks..

Animal
25 Aug 2010, 12:21 AM
Have you read the API docs for Record and Store?