PDA

View Full Version : Reset and itemselector plugin



khoivu4477
8 Sep 2010, 11:30 AM
I am using the itemselector plugin (Ext.ux.form.ItemSelector). My form has a reset button which can reset the form data back to the same data when the form first loaded. The problem is that myform().reset will invoke the itemselector.reset() method, and the itemselector.reset() method just remove all items on the added list and add those back to the available list.

I look at the code, and the itemselector.reset() is as below



reset: function(){
range = this.toMultiselect.store.getRange();
this.toMultiselect.store.removeAll();
this.fromMultiselect.store.add(range);
var si = this.fromMultiselect.store.sortInfo;
if (si){
this.fromMultiselect.store.sort(si.field, si.direction);
}
this.valueChanged(this.toMultiselect.store);
}


How can I make the itemselector plugin to reset to the data that is first loaded?

Thank you.