steph04
29 Feb 2008, 5:30 AM
Hi,
I have a list of objects in a grid and when I select an object I load in a form the data of the object. To verify if it has changed (and save power) when I selected another object I implement a new feature.
I have implemented a new feature in a new class that extends "BaseForm" which call "isChanged", and i have override the method "createForm" in a new class that extends "FormPanel":
Ext.form.myFormPanel = Ext.extend(Ext.form.FormPanel, {
createForm: function(){
delete this.initialConfig.listeners;
return new Ext.form.myBasicForm(null, this.initialConfig);
}
});
Ext.form.myBasicForm = Ext.extend(Ext.form.BasicForm, {
isChanged: function(){
var changed = false;
values = this.getValues();
this.items.each(function(f){
if(String(values[f.name]) != String(f.value)) {
changed = true;
return false;
}
});
return changed;
}
});
It might well be that this feature to add to your library
You are doing great work
thanks
St
I have a list of objects in a grid and when I select an object I load in a form the data of the object. To verify if it has changed (and save power) when I selected another object I implement a new feature.
I have implemented a new feature in a new class that extends "BaseForm" which call "isChanged", and i have override the method "createForm" in a new class that extends "FormPanel":
Ext.form.myFormPanel = Ext.extend(Ext.form.FormPanel, {
createForm: function(){
delete this.initialConfig.listeners;
return new Ext.form.myBasicForm(null, this.initialConfig);
}
});
Ext.form.myBasicForm = Ext.extend(Ext.form.BasicForm, {
isChanged: function(){
var changed = false;
values = this.getValues();
this.items.each(function(f){
if(String(values[f.name]) != String(f.value)) {
changed = true;
return false;
}
});
return changed;
}
});
It might well be that this feature to add to your library
You are doing great work
thanks
St