extjs4

How to add more than 3 SERIES in a LINE or SCATTER chart?

霸气de小男生 提交于 2019-12-06 03:53:45
When I try to add more than 3 SERIES in a LINE or SCATTER chart, an exception occurs: In Google Chrome: Uncaught TypeError: Property 'undefined' of object [object Object] is not a function In Firefox: Ext.chart.Shape[type] is not a function [Stop this error] }, attr)); This was identified by ExtJS Support as a bug: http://www.sencha.com/forum/showthread.php?140932-How-to-add-more-than-3-SERIES-in-a-LINE-or-SCATTER-chart Below follow the code: Ext.require('Ext.chart.*'); Ext.define('AM.view.user.ScatterGraphic', { extend : 'Ext.chart.Chart', alias : 'widget.scatterGraphic', title : 'All Users',

ExtJS4: Why when I use directFn config in my store I need to specify directCfg.method as directFn's property

ⅰ亾dé卋堺 提交于 2019-12-06 03:02:37
问题 Recently I was using directFn config like this: var store = new Ext.data.Store({ proxy: { type: 'direct', directFn: myDirectfn, ... But it wouldn't work because ExtJS threw exception Uncaught TypeError: Cannot read property 'method' of undefined at the lines method = fn.directCfg.method; if (method.ordered) { in file path/to/ext/src/data/proxy/Direct.js . After some digging I've found out that fn refers to myDirectfn function. So I've just added lines: myDirectfn.directCfg = { method: {} };

Extjs store load success handler not getting fired

柔情痞子 提交于 2019-12-06 02:38:21
问题 I have a store load method which returns data via an ajax request. I can see that the data is being returned using Firebug, but my success handler is not getting called: this.getCategoriesStore().load({params:{'id':d.data.category_id}}, { success: function(category) { console.log("Category: " + category.get('name')); }, error: function(e) { console.log(e); } }); I am returning a success parameter, along with the data: {"success":true,"categories":{"id":5,"name":"Frying","section_id":2}} Is

dynamic add items to border viewport

自作多情 提交于 2019-12-06 01:09:57
I want to create a empty viewport(layout:border) first, then add items to it, finally render and show. but when I created the viewport element, it throw an error, says: Uncaught TypeError: Cannot read property 'flex' of undefined here are my code: <script type="text/javascript" src="ext-4.0.2a/bootstrap.js"></script> <script> Ext.require(['*']); Ext.onReady(function() { Ext.QuickTips.init(); var viewport = Ext.create('Ext.container.Viewport', { layout: 'border' }); var north = blablabla... viewport.add([north,south]); viewport.doLayout(); }); </script> According to notes that are taken from

ExtJS findExact() and custom validator bug

你说的曾经没有我的故事 提交于 2019-12-06 00:20:46
I'm using a custom validator on my combobox's: function(v) { console.log(v === 'some value I know for SURE is in the store'); // (1) var index = this.getStore().findExact(this.displayField, v); return (index!==-1) ? true : 'Invalid selection'; } Basically admits the same set as forceSelection but allows the user to type arbitrary text to attempt to auto-complete. However; I'm having really odd results with findExact() . For example, if the combobox's value is currently valid , and a user does a space + backspace , the validator will fail , even though the output of (1) is true . Any ideas what

How to set html to a element in extjs

拜拜、爱过 提交于 2019-12-05 22:26:14
问题 1) How to set HTML to already created panel or any other Element? I am a beginner. I tried the below to set some content inside the HTML var clickedElement = Ext.getCmp('id').el.child('>'); clickedElement.setHTML("hello"); The above is working fine but the problem is that as the panel has many div's inside it.. the above approach is erasing those inside html (i.e div's) and replacing it with the above content. I saw through Chrome that the panel has three nested div's. So, if I want to add

ExtJS 4.2.1 - add textfield to an XTemplate

回眸只為那壹抹淺笑 提交于 2019-12-05 21:49:16
I got a custom component in which i set the html with an xtemplate something like this Ext.apply(me, { html: mainTpl.apply() }); I want to add some textfields to my XTemplate too and i cant figure out how to do this. new Ext.XTemplate('<div Class="TopHeaderUserInfo"><div id="TopHeaderLanguageDiv" ><div Class="ActiveLanguageFlag" lang="{[ this.getLanguage() ]}" ></div>' + '<ul Class="LangSelectDropDown HeaderDropDown" style="position:absolute;"><li class="ListHeader">' + MR.locale.SelectLanguage + '</li>{[ this.renderLanguageItems() ]}</ul>' + '</div>{[this.renderUserInfo()]}</div>', { ... ...

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

寵の児 提交于 2019-12-05 21:21:14
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 You can use .load({addRecords: true} to add loaded records to existing records. Of course if you load again with the addRecords: true option enabled it

changing background colors of grid rows dynamically in extjs 4.2.2

本小妞迷上赌 提交于 2019-12-05 21:15:55
问题 I have my grid which loads a list of data, and some of the data should change the background value by a specific date value. If the date is smaller then the today's date, it should use the css class of 'now', otherwise 'later'. It does work fine, but my problem is that only one row is changing the background color, so it doesn't go through the whole list. heres my grid: grid = Ext.create('Ext.grid.Panel', { store: store, xtype: 'gridpanel', columns: [ { text: 'Name', dataIndex: 'name', tdCls:

Getting a loaded store in extjs4

我是研究僧i 提交于 2019-12-05 20:18:51
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){ console.log('Load successful'); } console.log(records[0].get('name')); console.log('scheme Data