Hi, I would like to know how to reset the items in form panel on clicking 'reset' button in view, from ViewController (using MVVM architecture)?
Hi, I would like to know how to reset the items in form panel on clicking 'reset' button in view, from ViewController (using MVVM architecture)?
In your view:
In your ViewController:Code:// toolbar text: 'Reset', handler : 'resetForm'
Code:resetForm : function (button) { var form = this.getView(); .. }
hi, I did as you mentioned above, but it is not working still. I am able to see the controll goes to that respective method in ViewController.
Getting error as "Uncaught TypeError: undefined is not a function"
In View,
-----------------------------
{
xtype : 'button',
text : 'Reset',
iconCls : 'reset-icon',
handler : 'resetRFButton',
}
-----------------------------
In view controller,
-----------------------------
resetRFButton: function(){
console.log('in reset');
console.log('Form clear->'+this.getView().reset());
}
-------------------------------
It seems that this.getView() does not return an instance of form - check it. You may also try this.getView().getForm().reset();
Jozef Sakalos, aka Saki
Education, extensions and services for developers at new http://extjs.eu
News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy
Sorry, I have by mistake deleted your post where you say that it does not work.
Well, run it through standard debugging procedures, e.g. stop the execution just before reset call, check if you get the correct view with getView, etc.
Or post a runnable showcase at https://fiddle.sencha.com we can take a deeper look.
Jozef Sakalos, aka Saki
Education, extensions and services for developers at new http://extjs.eu
News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy