extjs4

ExtJS - How to reference “self” in a custom function in a custom class?

别来无恙 提交于 2019-12-22 17:54:46
问题 How do I reference an instance of a custom class inside a custom function defined within the class? I've extended a class through ExtJS4's class extension "mechanism", and I've a custom event handler that will be called when something is triggered, and I want to collapse the Panel when something is fired. However, in the event handler of the Reactor class below, "this" references EventTriggerer (The firer of the event) instead of the instance of the Reactor. How do I reference the instance of

How to skip over particular cells when tabbing through an Ext grid?

戏子无情 提交于 2019-12-22 16:11:21
问题 I have a grid panel where some cells are editable, and others aren't. I'd like to make it so that when you tab through the grid with your keyboard, the non-editable cells are skipped over i.e. never get selected. Here's my simple grid so far: var store = Ext.create('Ext.data.Store', { fields:['name', 'age', 'country'], data:[ {name:'Lisa', age:13, country: 'USA'}, {name:'Bart', age:75, country: 'France'}, {name:'Homer', age:32, country: 'Germany'}, {name:'Marge', age:56, country: 'Australia'}

path of view is incorrect in extjs 4 mvc application

六月ゝ 毕业季﹏ 提交于 2019-12-22 14:13:41
问题 I'm trying to deploy my mvc app into my large web application. I have defined the app folder and can see in fire bug that it is calling the correct files with the exception of the initial view. So "App.view.Jobs" is calling https://www.estore.localhost/Jobs/Edit/ext/jobs/App/view/Jobs.js?_dc=1328471746967 when i would like it to call https://www.estore.localhost/ext/jobs/App/view/Jobs.js?_dc=1328471746967 Ext.Loader.setConfig({ enabled: true }); Ext.application({ name: 'MyApp', appFolder: '

extjs 4 How too keep combobox in grid cell

北战南征 提交于 2019-12-22 12:25:56
问题 I've seen similar questions go unanswered elsewhere. I want to have a combobox in a column with two options (ASC, DEC) in it. I want it to show up in each row, or at least have its value show up when it's not selected. I know that its not a 'good idea' to render a combobox in each row, but in this case I know I will have a maximum of about 20 rows, so it shouldn't be a huge deal. If this can't be done I want to have the selected value from the combobox show. Currently I just have the

Getting a loaded store in extjs4

北城余情 提交于 2019-12-22 10:29:06
问题 I am getting null while I try to obtain a loaded store from the controller. The load is a successful one too. I verified that. I have the store as follows. Ext.define('GridApp.store.schemedatastore',{ extend: 'Ext.data.Store', model: 'GridApp.model.schemedatamodel', autoLoad: true, alias: 'store.schemedata', storeId: 'schemedatastoreid', constructor:function(){ console.log('Calling parent'); this.callParent(arguments); }, listeners: { load:function(store,records,isSuccessful){ if(isSuccessful

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

How can I access class variables in an ExtJS event handler?

こ雲淡風輕ζ 提交于 2019-12-22 06:49:11
问题 this.getUrl = 'test'; this.items.add( new Ext.form.Checkbox( { listeners: { check: function(checkbox, checked) { alert(this.getUrl); }, } ) ) How do I access this.getUrl in the check handler? 回答1: There are multiple ways to access the property getUrl . Here are the few possible options: 1. Use Ext.getCmp : If you set an id for your FormPanel (or other extjs component whatever you are using), you can access it using Ext.getCmp() method. So, var yourComponent = Ext.getCmp('yourComponentId');

Highlight a part of an extjs4 line chart

一曲冷凌霜 提交于 2019-12-22 06:35:43
问题 In the extjs 4.1.1a code below is a working example of a line chart. Now I need to highlight a part of that chart on a given min and max timestamp. {'xtype' : 'chart', 'store' : 'ChartData', 'height' : '100%', 'width' : '100%', 'legend' : {'position' : top}, 'axes': [{ 'title': 'Power', 'type': 'Numeric', 'position': 'left', 'fields': ['power'] },{ 'title': 'Timestamp', 'type': 'Numeric', 'position': 'bottom', 'fields': ['timestamp'], 'minorTickSteps': 3 }], 'series': [{ 'type': 'line', 'fill

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",

How do you attach click events to ExtJS template elements?

空扰寡人 提交于 2019-12-22 05:59:08
问题 How would I add a click event to each link tag in this other than by building in onclick=.... into the XTemplate? new Ext.XTemplate( '<ul>', '<tpl for="."><li><a href="#{anchor}">{text}</a></li></tpl>', '</ul>' ).overwrite('someElement', [ { text: 'Click me', anchor: '1' }, { text: 'No, click me', anchor: '2'} ]); 回答1: The short answer is, you don't. Instead, you should use event delegation: Ext.get('someElement').on('click', function(event, target) { console.log(target); }, null, {delegate: