extjs4

extjs - Store with autoload true should not load on application launch

我与影子孤独终老i 提交于 2019-12-12 07:56:43
问题 I have a grid linked to a store with autoLoad: true . The problem is that the store gets loaded on application launch, even if the view is created only later when accessed through a menu. I have referenced the store in Application.js and in the view, but I'm not instatiating explicitly neither the store nor the view. I don't know how to achieve that the store is loaded only when needed by the view. If I set autoLoad: true , the store gets loaded on application launch. If I set autoLoad: false

ExtJS Grid SelectionChange is fired in other controller

最后都变了- 提交于 2019-12-12 06:26:33
问题 I have a main application with a left navigation menu. My Main.js controller handles the treepanelselect event where a Tab is added: onTreepanelSelect: function (selModel, record, index, options) { var mainPanel = Ext.ComponentQuery.query('mainpanel')[0]; var newTab = mainPanel.items.findBy( function (tab) { return tab.title === record.raw.text; }); if (!newTab) { newTab = mainPanel.add({ xtype: record.raw.class_name, // this is my View widget name closable: true, iconCls: "key", title:

change the html from controller in extjs

孤人 提交于 2019-12-12 06:25:59
问题 In my Extjs 4.1.1a project, Fiddle ( this fiddle is not working, it is just for reference ) I am changing the HTML(In controller) value using Ext.apply(weekNotifications,{html: {"hello"}); But the page(view) is not updating. When I checked the variable weekNotifications in Chrome console, after the above function, the innerHTML is "hello" as I added but in weekNotifications.el.dom.innerHTML is "Notifications here" (old text). I even tried: weekNotifications.update("Hello"); //same problem as

ExtJS - Adding headers to AJAX store

一笑奈何 提交于 2019-12-12 05:38:48
问题 Despite that I have configured the headers configuration of my store, getting an error like this: No 'Access-Control-Allow-Origin' header is present on the requested resource . Here is my proxy configuration of Ext.data.Store : proxy : { type : 'ajax', headers : { 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'POST, GET, OPTIONS, DELETE, PUT', 'Access-Control-Max-Age': '1000', 'Access-Control-Allow-Headers': 'x-requested-with, Content-Type, origin, authorization, accept,

Store with json reader is not working

99封情书 提交于 2019-12-12 05:31:33
问题 I have following json created after I sereliaze a dictionary {"Results":["{\"BaseCurrency\":\"USD\",\"TermCurrency\":\"JPY\"}","{\"BaseCurrency\":\"USD\",\"TermCurrency\":\"JPY\"}","{\"BaseCurrency\":\"USD\",\"TermCurrency\":\"JPY\"}","{\"BaseCurrency\":\"USD\",\"TermCurrency\":\"JPY\"}"],"Total":4} When I try to load it into the extjs store , the store is not loaded var store = Ext.create('Ext.data.Store', { fields: fields, pageSize: itemsPerPage, proxy: { type: 'ajax', url:

Sencha CMD - Build Error: Mixed-Mode x-compile and microload markup is currently unsupported

无人久伴 提交于 2019-12-12 04:54:45
问题 Good day, I am trying to build my ExtJS 4.2 application and I am using Sencha Architect 3.1 and Sencha CMD 5.1.1.39 for the OSX. I was following this tutorial on how to build from the Terminal, and as expected, I got this error: com.sencha.exceptions.ExBuild: Mixed-Mode x-compile and microload markup is currently unsupported Upon googling, I came upon this thread from Sencha discussing how to get around this error. What I did next was to remove lines from my app.json file which originally

What ExtJS 4.2 standard function gets executed for grid selection when using Ext.selection.RowModel (default) selModel?

杀马特。学长 韩版系。学妹 提交于 2019-12-12 04:44:44
问题 There is a bug with the way the Ext.grid.Panel rowexpander plugin works when a nested grid is set to renderTo to the rowexpander div id. When this is implemented, it's difficult to see what is actually being selected. The reason for this is because the config "disableSelection" and "trackMouseOver" are to be both considered for highlighting. I have to set "trackMouseOver: false" so that hovering over grid rows doesn't interfere with reproducing this behavior. Then "disableSelection: false"

How to modify fields before rendering it to the grid in Extjs

隐身守侯 提交于 2019-12-12 04:07:26
问题 I have to append a value to the data fetched from the store before rendering it to the grid in ExtJs. Please guide me on achieving the above mentioned functionality. Currently the grid is populated in the following manner: Ext.define("MyApp.view.ShowDetails",{ extend: 'Ext.grid.Panel', requires:['MyApp.store.MyStore'], store:'MyStore', stateId: 'stateGrid', selType : 'checkboxmodel', selModel : { mode : 'MULTI' }, plugins : [Ext.create('Ext.grid.plugin.RowEditing', { clicksToEdit : 2 })],

Using BoundList as widget

落花浮王杯 提交于 2019-12-12 03:43:02
问题 I have an extended bound list, and I use it as a widget. Get/set value and other works good, but: How can I add a field label before it? Example of set value: setValue: function (v) { this.value = v; // TODO select selected var sm = this.getSelectionModel(); var store = this.getStore(); var rec = store.findRecord(this.valueField, v); sm.select(rec); }, Can you help me? Or is the only solution that I have to put this bounding list in a panel? 回答1: The easiest way to get around this is to put

How to refer the store in Controller --> Code.js file?

╄→гoц情女王★ 提交于 2019-12-12 03:29:12
问题 I am storing the JSON format in to Code.js of store folder. 'store' folder --> Code.js Ext.define('LoginPage.store.Code', { extend: 'Ext.data.Store', model: 'LoginPage.model.Code', autoLoad: true, proxy: { type: 'ajax', api: { read: 'data/loginResponse.json', update: 'data/checkCredentials.json' //contains: {"success": true} }, reader: { type: 'json', root: 'login', successProperty: 'success' } } }); 'model' folder --> Code.js Ext.define('LoginPage.model.Code', { extend: 'Ext.data.Model',