Why when I open my form through a window and I change nothing and I agree, my grid item stacks instead of recharged my grid? but I change the values of my form and I agree, my grid is reloaded correctly?
Thanx in advance
EDIT : Store.sync returns an error if you do not change the data
My code:
var modele = Modeles[activeTabParametresApplicatifs]; // Ex: Name
var id = 'Id'+modele; // IdName
var chaine = activeTabParametresApplicatifs; // TabNames
var store = chaine.substr(3,chaine.length); // Names
eval ('record = Ext.create(\'ModuleGestion.model.'+modele+'\');');
eval ('store = this.get'+store+'Store()');
var win = button.up('window'),
form = win.down('form');
record = form.getRecord();
values = form.getValues();
eval ('var id = values.'+id);
if (form.isValid()) {
if (id > 0){
record.set(values);
} else{
record.set(values);
store.add(record);
}
store.sync({
success : function() {
store.load();
}
});
win.close();
}