extjs4.1

ExtJS 4.1 : How to combine local data with ajax loaded data in a single store?

ぃ、小莉子 提交于 2019-12-22 09:45:34
问题 I'm looking for a way to combine local data with ajax loaded data in a single store. It's difficult for me to explain this in english, I hope this piece of code will be more explicit : var store = Ext.create('Ext.data.Store', { autoLoad: true, fields: ['id', 'name'], proxy: { type: 'ajax', api: { read: '/read' } }, data: [{ id: 1, name: 'John' }] }); Json returned by "/read" : [{ id: 2, name: 'Jack' }] . Desired behaviour : store.count() // 2 回答1: You can use .load({addRecords: true} to add

extjs parsing nested json in template

ε祈祈猫儿з 提交于 2019-12-22 06:37:22
问题 Trying (unsuccessfully) to display data from nested json. JSON might look something like: { "contacts": [ { "id": "1", "client_id": "135468714603", "addresses": [ { "id": "1", "contact_id": "1", "address_id": "16", "address": { "0": { "id": "16", "address": "123 Some Rd", "address2": "", "city": "Toen", "state": "VS", "zip_code": "11111", "country": "USA" } } }, { "id": "6", "contact_id": "1", "address_id": "26", "address": { "0": { "id": "26", "address": "1 Other Road", "address2": "", "city

Unable to render data into grid column using JSON results

两盒软妹~` 提交于 2019-12-22 06:32:05
问题 I have a grid store with something like this. var gridStore = Ext.create('Ext.data.Store',{ proxy : { type : 'ajax', actionMethods : { read : 'POST' }, url : 'getECIAgentWrapperJobs.do', reader : { type : 'json', rootProperty : 'rows', totalProperty : 'results' } }, pageSize : 3, autoLoad : {start: 0, limit: 3} }); Clearly it makes an AJAX request to the url. The JSON response that I am getting for this store looks something like this : { "results":2, "rows":[ { "pkTable1":1, "name":"Rick",

dynamically set fields to a extjs data store

自作多情 提交于 2019-12-21 05:41:43
问题 I am trying to dynamically set fields to a extjs data store so that I could dynamically create a different grid at run time. Case A works for me. But when I use as in Case B , the store's proxy hangs on to the previous model and so the grid rendering is messed up. What is the really the difference between these two? Case A Ext.define('FDG.store.reading.FDGDynamicGridStore', { extend: 'Ext.data.Store' }); var fdgstore = Ext.create('FDG.store.reading.FDGDynamicGridStore', { fields: fields,

Extjs - How to show combobox in Grid column

白昼怎懂夜的黑 提交于 2019-12-20 17:32:30
问题 I have a gridpanel include date and combo column jsfiddle But I don't want click to show my combo. I want show my combo without click, not hide inside cell like and the same for date column like I think chage to clicksToEdit: 0 but fail plugins: [ Ext.create('Ext.grid.plugin.CellEditing', { clicksToEdit: 1 }) ] How to do that, thanks 回答1: The only way to achieve this in 4.2x or below is to use a custom component like Skirtle's comonent column http://skirtlesden.com/ux/component-column This

Ext 4.1.1: Add new record to Store

天大地大妈咪最大 提交于 2019-12-18 22:59:10
问题 I would like to add records after the initialization of a store. I tried loadData(), loadRawData(), add() but nothing seams to work. Here is my jsfiddle: http://jsfiddle.net/charlesbourasseau/zVvLc Any ideas ? 回答1: You need to set queryMode: 'local' in the combo box. Minimal example: Ext.onReady(function() { var store = Ext.create('Ext.data.Store', { alias: 'store.ModeStore', autoLoad: false, fields: [{ name: 'mode', type: 'string' }, { name: 'id', type: 'string' }], data: [{ mode: 'mode1',

ExtJS 4.1 - Returning Associated Data in Model.Save() Response

强颜欢笑 提交于 2019-12-18 19:12:01
问题 I am curious as to why the record contained in the result set of a Model.save() response does not properly return updated associated data, despite the updated data being contained in the server response... Example Model & Store Definition: Ext.define("App.model.test.Parent",{ extend: 'Ext.data.Model', requires: ['App.model.test.Child'], fields: [ {name: 'id', type: 'int' }, {name: 'name', type: 'string'}, {name: 'kids', type: 'auto', defaultValue: []} ], idProperty: 'id', hasMany: [{

An Extjs App Calling another Extjs APP

断了今生、忘了曾经 提交于 2019-12-18 12:00:38
问题 after generating a Workspace using Sencha Cmd and create Two different app, i just want to Run the first app and then after clicking a button,it calls the second app :) Like A main app calling another sub-app is there a way to do it ? thx for your help 回答1: You can develop separated modules that can work together with no problems. Both concepts are no in conflict at all. Let me share my experience here. When we started in our current project (from the scratch) there were other two teams

What is the use of initComponent function in extjs4.1?

痞子三分冷 提交于 2019-12-18 11:30:25
问题 Can anybody tell me what the use of the initComponent function is in extjs4.1? Please provide an example Thanks 回答1: This method is akin to a constructor for components. It is called by the true constructor , and is a really good hook point to customize the initialization of the component (as said in the name!). Except in some very rare occasions, you should override initComponent instead of the constructor because the more basic initialization will already have taken place. Most notably, the

up() and down() versus Ext.getCmp()

梦想与她 提交于 2019-12-17 07:25:10
问题 I'm very confused which one I need to use for grep object between up() down() and Ext.getCmp(ID). For me, it is easier that define ID to object and retrieve the object by Ext.getCmp('ID') and the code looks more clean. For example: console.log(this.up('panel').up('panel').down('grid')); console.log(Ext.getCmp('myPanel')); which one is better for performance? 回答1: There are severe gotchas with using IDs and getCmp to find your components. The primary issue is that you can not reuse the