javascript - Finding difficulty in loading a form on click of a button -
i have grid panel , contains add button. on clicking button, pop of form should displayed. getting error continuously. http://localhost:8080/extservlet/myapp/widget/student-form.js?_dc=1438244873178 404 (not found)
here list.js file contains grid
ext.define('myapp.view.main.list', { extend: 'ext.grid.panel', xtype: 'mainlist', require: [ 'myapp.view.student.studentform' ], title: 'student records', scrollable: true, margin: 20, layout: { type: 'vbox', align: 'stretch' }, reference: 'studentgrid', frame: true, collapsible: true, store: 'studentstore', collapsible: true, columns: [ { text: 'name', dataindex: 'name', flex: 1 }, { text: 'address', dataindex: 'address', flex: 1 }, { text: 'phone', dataindex: 'phone', flex: 1 }, { text: 'email', dataindex: 'email', flex: 1 }, { text: 'faculty', dataindex:'faculty', flex: 1 } ], dockeditems: [ { xtype: 'toolbar', dock: 'top', items: [ { xtype: 'button', text: 'add', iconcls: 'fa fa-plus', listeners: { click: 'onadd' } }, { xtype: 'button', text: 'edit', iconcls: 'fa fa-edit', listeners: { click: 'onedit' } }, { xtype: 'button', text: 'delete', iconcls: 'fa fa-trash-o', listeners: { click: 'ondelete' } }] } ] });
and here controller
onadd: function(button, e, options) { this.createdialog(null); }, createdialog: function(record) { var me = this, view = me.getview(); debugger; me.dialog = view.add({ xtype: 'student-form' }) me.dialog.show(); }
and heres student form
ext.define('myapp.view.student.studentform', { extend: 'ext.window.window', alias: 'widget.student-form', height: 270, width: 400, layout: { type: 'fit' }, title: 'add student', closable: false, modal: true, items: [{ xtype: 'form', reference: 'form', bodypadding: 5, modelvalidation : true, layout: { type: 'vbox', align: 'stretch' }, items: [{ xtype: 'fieldset', flex: 1, title: 'student information', layout: 'anchor', defaulttype: 'textfield', defaults: { anchor: '100%', msgtarget: 'side', labelwidth: '75' }, items: [ { xtype: 'hiddenfield', name: 'id', fieldlabel: 'label' }, { fieldlabel: 'name' }, { fieldlabel: 'address' }, { fieldlabel: 'phone' }, { fieldlabel: 'email' }, { xtype: 'combo', fieldlabel: 'faculty', displayfield: 'name', valuefield: 'id', querymode: 'local', forceselection: true, editable: false, name: 'faculty-id', } ], dockeditems: [ { xtype: 'toolbar', dock: 'bottom', layout: { pack: 'end', type: 'hbox' }, items: [ { xtype: 'button', text: 'save', iconcls: 'fa fa-check', listeners: { click: 'onsave' } }, { xtype: 'button', text: 'cancel', iconcls: 'fa fa-times', listeners: { click: 'oncancel' } } ] }] }] }] });
so, how can load student form pop window. suggestion?
heres error list:
get http://localhost:8080/extservlet/myapp/widget/student-form.js?_dc=1438247043981 404 (not found)
uncaught error: [ext.create] unrecognized class name / alias: widget.student-form
[e] [ext.loader] requested files failed load.
in controller's method change from:
createdialog: function(record) { var me = this, view = me.getview(); debugger; me.dialog = view.add({ xtype: 'student-form' }) me.dialog.show(); }
to:
createdialog: function(record) { ext.createwidget('student-form'); }
Comments
Post a Comment