Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Hi @sineverba sorry for response a little late, but here something this how you want show,</p> <p><strong>Viewport.js</strong></p> <pre><code>Ext.define('myapp.view.Viewport' , { extend : 'Ext.viewport.Default', xtype : "viewport", config: { fullscreen: true, styleHtmlContent: true, style: 'background:#ffffff;', layout : 'card', autoDestroy : false, cardSwitchAnimation : 'slide', items: [ { xtype: 'appre-searchCap' }, ], } }) </code></pre> <p><strong>app.js</strong></p> <pre><code>Ext.Loader.setConfig({ enabled: true }) Ext.application({ name: 'myapp', requires: [ 'myapp.view.SearchCap', 'myapp.view.ElencoRistoranti', 'myapp.view.SearchElenco', ], controllers: ['SearchCap'], models: ['myapp.model.SearchCapModel'], launch: function() { Ext.create('myapp.view.Viewport') } }); </code></pre> <p><strong>SearchCapModel.js</strong></p> <pre><code>Ext.define('myapp.model.SearchCapModel', { extend: 'Ext.data.Model', config: { idProperty: 'id_restaurant', fields: [ { name: 'id_restaurant', type: 'string' }, { name: 'name', type: 'string'}, { name: 'zip', type: 'string' }, { name: 'lat', type: 'string'}, { name: 'lgt', type: 'string'} ], } }) </code></pre> <p><strong>SearchCapStore.js</strong></p> <pre><code>Ext.define('myapp.store.SearchCapStore', { extend: 'Ext.data.Store', config: { model: 'myapp.model.SearchCapModel', autoLoad: true, proxy: { type: 'ajax', url : 'cerca-ristoranti-cap.json', reader: { type: 'json', rootProperty: 'restaurants' } //reader }, } }); </code></pre> <p><strong>SearchCap.js</strong></p> <pre><code>Ext.define('myapp.controller.SearchCap', { extend : "Ext.app.Controller", views: ['SearchElenco'], config : { refs : { elencoListContainer: 'elencolistcontainer', btnSubmitLogin: 'button[action=searchCap]', form : 'appre-searchCap', }, control : { btnSubmitLogin : { tap : "onSubmitLogin" } } }, onSubmitLogin : function() { console.log("onSubmitLogin"); var values = this.getForm().getValues(); console.log(values); Ext.Ajax.request({ url: 'cerca-ristoranti-cap.json', method: 'POST', params: { values: Ext.encode({form_fields: values}) }, success: function(response, opts) { var obj = response.responseText; Ext.Msg.alert('Contact Complete!', obj); Ext.Viewport.add(Ext.create('myapp.view.SearchElenco')); Ext.Viewport.setActiveItem(1); }, failure: function(response, opts) { console.log('server-side failure with status code ' + response.status); } }); }, resetForm: function() { this.getForm().reset(); }, launch : function() { this.callParent(); console.log("LoginForm launch"); }, init : function() { this.callParent(); console.log("LoginForm init"); } }); </code></pre> <p><strong>SearchElenco.js</strong></p> <pre><code>Ext.define('myapp.view.SearchElenco', { extend: 'Ext.Container', xtype: 'elencolistcontainer', requires: ['myapp.store.SearchCapStore'], initialize: function() { this.callParent(arguments); var s = Ext.create('myapp.store.SearchCapStore') var notesList = { xtype: 'appre-elencoristoranti', store: Ext.getStore(s).setAutoLoad(true), listeners: { disclose: { fn: this.onNotesListDisclose, scope: this } } }; this.add([notesList]) }, onNotesListDisclose: function(list, record, target, index, event, options) { console.log('editNoteCommand'); this.fireEvent('editNoteCommand', this, record); }, config: { layout: { type: 'fit' } } }); </code></pre> <p><strong>ElencoRistoranti.js</strong></p> <pre><code>Ext.define('myapp.view.ElencoRistoranti', { extend: 'Ext.dataview.List', xtype: 'appre-elencoristoranti', id: 'appreElenco', config: { emptyText: '&lt;pre&gt;&lt;div class="notes-list-empty-text"&gt;No list found.&lt;/div&gt;&lt;/pre&gt;', onItemDisclosure: false, itemTpl: '&lt;pre&gt;&lt;div class="list-item-title"&gt;{id_restaurant}&lt;/div&gt;&lt;div class="list-item-narrative"&gt;{name}&lt;/div&gt;&lt;/pre&gt;', } }); </code></pre> <p><strong>SearchCap.js</strong> - View</p> <pre><code>Ext.define('myapp.view.SearchCap', { extend: 'Ext.form.Panel', xtype: 'appre-searchCap', id: 'appreSearchCap', config: { layout: { type: 'vbox', }, items: [ { xtype: 'fieldset', title: 'Cap', instructions: 'Enter Cap', items: [ { xtype: 'textfield', name: 'cap', placeHolder: 'Cap' }, { xtype: 'button', text: 'Cerca', ui: 'confirm', action :'searchCap', id:'btnSubmitLogin' } ] // items } ] // items }, // config initialize: function() { this.callParent(arguments); console.log('loginform:initialize'); } }); </code></pre> <p><img src="https://i.stack.imgur.com/vmdgc.png" alt="enter image description here"></p> <p><strong>I hope help you and if you have a dude please let me know. :)</strong></p>
 

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