extjs-mvc

Can't resolve “c is not a constructor” error

瘦欲@ 提交于 2019-12-01 21:26:22
I'm trying to build a very very basic "proof of concept" app using ExtJS but i'm having a very hard time. All i want is two grids getting their data from a remote JSON file, but no matter what i do i keep on getting the error that's in the subject. Here is my simple code: app.js: Ext.Loader.setConfig({enabled:true}); Ext.application({ name: 'GeoSniffer', autoCreateViewport: true, models: ['Location', 'Client'], stores: ['Locations', 'Clients'], }); Viewport.js Ext.define('GeoSniffer.view.Viewport', { extend: 'Ext.container.Viewport', layout: 'fit', requires: [ 'GeoSniffer.view.ClientsList',

Ext JS 4 - How to control rowEditor inside controller

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 00:07:17
I want to learn how can I controller rowEditor plugin inside controller.. Here's rowEditor definition: Ext.define(appName + '.view.department.DepartmentGrid', { initComponent: function() { this.rowEditor = Ext.create('Ext.grid.plugin.RowEditing', { clicksToEdit: 2 }); } } ** Controller** this.control({ 'departmentgrid': { // ?? } }); It's in the docs: http://docs.sencha.com/ext-js/4-1/#!/api/Ext.grid.plugin.RowEditing-event-edit this.control({ 'departmentgrid': { edit: this.onDepartmentGridEdit } }); 来源: https://stackoverflow.com/questions/11914525/ext-js-4-how-to-control-roweditor-inside

Ext JS 4 - How to control rowEditor inside controller

*爱你&永不变心* 提交于 2019-11-30 18:20:33
问题 I want to learn how can I controller rowEditor plugin inside controller.. Here's rowEditor definition: Ext.define(appName + '.view.department.DepartmentGrid', { initComponent: function() { this.rowEditor = Ext.create('Ext.grid.plugin.RowEditing', { clicksToEdit: 2 }); } } ** Controller** this.control({ 'departmentgrid': { // ?? } }); 回答1: It's in the docs: http://docs.sencha.com/ext-js/4-1/#!/api/Ext.grid.plugin.RowEditing-event-edit this.control({ 'departmentgrid': { edit: this

Override Ext.data.Connection - Best Practice

可紊 提交于 2019-11-30 09:57:20
I need to override Ext.data.Connection to show a Login Form. I do this at the moment in Ext.application.launch which works as expected. Is it possible to swap this piece of code somewhere different like in an extra file? If you need this only to recognize when user is not authenticated you might want to consider doing something else. Like adding a handler to Ajax singleton: function addAjaxErrorHandler(object) { Ext.Ajax.on('requestexception', function(conn, response, options, e) { var statusCode = response.status, errorText = null, captionText = response.statusText; // 404 - file or method

Using more than one controller with ExtJS 4 MVC

时光怂恿深爱的人放手 提交于 2019-11-27 11:48:25
问题 Let's say I have a main controller, then my application has a controller for each "module". This main controller contains the viewport, then a header (with a menu) + a "centered" container, which is empty at the beginning. A click in the menu will change the current module/controller and the adhoc view (which belongs to this controller) will be displayed in the centered container. I think it's a very simple scenario, but strangely I didn't find the proper way to do it. Any ideas? Thanks a lot

Attach ExtJS MVC controllers to DOM elements, not components

懵懂的女人 提交于 2019-11-27 10:22:44
问题 Is there a way to use the Ext.app.Controller control() method, but pass in a DOM query? I have a page that contains standard links and would like to add a click handler to them even though they were not created as Ext Buttons. I've tried Ext.define('app.controller.TabController', { extend: 'Ext.app.Controller', init: function() { console.log("init"); this.control({ 'a': { click: this.changeTab } }); }, changeTab: function() { alert("new tab!"); } }); But clicking on links does not fire the