10 Jan 2012 11:40 PM #1
Hi,<br><br>I have a window with some checkboxes, datefields, comboboxes, and an Apply Button. If I click the apply button, the window should retain the values that were appllied. But if I close the window without clicking the Apply button, the window should reset the values for all the fields to where the window had opened.<br>What I did was applying the changes which are required when the apply button is clicked, and then calling the hide(). If the window is closed without clicking the apply button, I call the 'beforehide' event and reset the elements to their previous values.<br>To make the beforehide event function independently of the apply button I'v used some flags.<br><br>I want to know if there is a built-in way in ext, that helps store the values of the fields before I hit on apply or close button. So that if apply is not clicked the window can load the values from that place, when it is reloaded. I'v already achieved this by creating an array which stores all the field values, but I want a way in which Ext does this for me.<br><br>Thanks in advance<br><br>
11 Jan 2012 8:13 AM #2
- Join Date
- Mar 2007
- St. Louis, MO
- Vote Rating
closeAction by default is set to 'close' which will destroy the window. So if you click the close tool button on the window, it will destroy the window. If you click apply, you can just hide() it. If the window is destroyed, create a new instance and the form should be blank. If it is already created, use that instance and the form should still have values.Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services firstname.lastname@example.org
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.