PDA

View Full Version : When adding rows to a grid need to auto set cells in row added to updated



m_notiar
15 Sep 2009, 5:13 AM
Hi,

I am adding rows to a grid. When I click on the save button I have a check to ensure that only rows with edited/updated cells are saved.

I want to ensure that all cells in rows added to the grid are autoset to Updated but am not sure how to do so. How do you auto set a cell to updated i.e. shows the red triangle in the corner of the cell. I have coped my row addition code below.

Thank you for your help.



{
text: 'Bulk Suggest',
tooltip:'Adds a row per underlyer pre-loaded with current data',
handler : function(){

Ext.Ajax.request({
url: 'products.do',
params: {action: 'underlyingSuggest'},
success: function(response, options) {
var data = Ext.util.JSON.decode(response.responseText);
dsUnderlying.removeAll();
var numberOfUnderlyers=data.list.underlying.length;
for ( var i=0; i<numberOfUnderlyers; ++i ){
var suggestedUnderlyer = new enUnderlying({'setdate': new Date(),'@underlyingId':data.list.underlying[i][email protected],'@underlyingSource':data.list.underlying[i][email protected],'@price':data.list.underlying[i][email protected],'@futureUndAdj':data.list.underlying[i][email protected],'@stopLossPremium':data.list.underlying[i][email protected],'@margin':data.list.underlying[i][email protected],'@repo':data.list.underlying[i][email protected]});
grid.stopEditing();
dsUnderlying.insert(0, suggestedUnderlyer);
}

},
failure: function(response, options) {
Ext.Msg.alert('Error', 'Error: Request seemed to have timed out [30secs]!');
bbUnderlying.setStatus({
text: 'ERROR : Could not save ' + currentCompo,
iconCls: 'ok-error',
clear: true
});
}
})
}
}