Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have gone through the snippet above because of following reasons.<br> 1) Json Syntax errors.<br> 2) You have messed up Ext.define and Ext.Create<br></p> <p>I have updated your scripts and tested it on my local machine. Its working!</p> <p>//Controller - app/controller</p> <pre><code> Ext.define('AM.controller.Users', { extend: 'Ext.app.Controller', views: [ 'user.List' ], stores: ['Users'], models: ['User'], init: function() { console.log('controller initialized'); this.control({ 'viewport panel button': { 'click': this.onButtonClick } }); }, onButtonClick: function(button, e, eOpts ) { var form = button.up('form').getForm(); var model = this.getModel('AM.model.User'); // Validate the form if (form.isValid ()) { var question = model.create(form.getFieldValues()); console.log(question.data); } else { alert("Insert values in textfields"); } } },function(){ console.log("Users Controller created"); }); </code></pre> <p>// View - app/view/user/list</p> <pre><code> Ext.define('AM.view.user.List', { extend: 'Ext.form.Panel', alias: 'widget.userlist', title: 'Question-option', width: 300, bodyPadding: 10, renderTo: Ext.getBody(), url: 'some url',// in case of ajax // initComponent: function(){ items: [{ xtype: 'textfield', name: 'Question', fieldLabel: 'Question', allowBlank: false // requires a non-empty value }, { xtype: 'textfield', name: 'Option', fieldLabel: 'Option' vtype: 'email' // requires value to be a valid email address format }, { xtype:'button', text:'Save' } ] },function(){ console.log("List view was created"); }); </code></pre> <p>Update your JS files and run! If you face any issues comment here</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload