PDA

View Full Version : detect changes in dd grids



nadeemshafi9
22 Jun 2009, 9:31 AM
hello guys i am trying to detect changes in my drag drop grids from sakis example, the prob is it loops throgh puts a nice star in my tab panel title but it keeps adding stars thgen it removes them one by one, i cant seem to follow it. any suggestions appreciated.



listeners: {
load: function(panel) {
// set totals
var grid2Total;
grid2Total = 0;

Ext.getCmp('grid2_managechannelpackages_'+m[0].data.id).getStore().each(function(r){
grid2Total = grid2Total + 1;
// check to see if grid 2 store has changed
grid_2_check[r.data.id] = r.data.id;
});
Ext.getCmp('grid2_managechannelpackages_'+m[0].data.id+'_total').setValue(grid2Total);
},
add: function(){
// check to see if grid 2 store has changed
panel = Ext.getCmp('updateChannelPanel_managechannelpackages_'+m[0].data.id);
Ext.getCmp('grid2_managechannelpackages_'+m[0].data.id).getStore().each(function(r){
if(!grid_2_check[r.data.id]){
panel.setTitle('*'+panel.title);
}
});
},
remove: function(){
}
}

nadeemshafi9
22 Jun 2009, 9:38 AM
it was because i had this on it keeps on doing a check



listeners: {
clientvalidation: function(formpanel, isvalid){
var panel = Ext.getCmp('updateChannelPanel_managechannelpackages_'+m[0].data.id)
if(formpanel.getForm().isDirty()){
if(panel.title.indexOf('*',0)){
panel.setTitle('*'+panel.title);
}
}
else {
panel.setTitle(panel.title.replace('*',''));
}
}
},
monitorValid: true,