extjs3

Property Grid in ExtJs

一曲冷凌霜 提交于 2019-12-02 11:52:46
I have some store, which is formed data. On panel it looks how "fieldName" and text field (in depension from invoked form). For example, on one form is displayed "name document" and field, on another: date of selling and date field. Data is formed dynamicly Here is store: tableTempStore = new Ext.data.JsonStore({ url: objectUrlAddress, baseParams: { 'objectID': objectID }, root: 'Fields', fields: [{ name: 'Type', type: 'int' }, { name: 'Value' }, { name: 'IsRequired', type: 'bool' }, { name: 'Identifier' }, { name: 'Data' }], listeners: { load: function(obj, records) { Ext.each(records,

Extjs Grid panel one column background Color change on another column value

自作多情 提交于 2019-12-02 07:21:20
问题 I have an Extjs Editor Grid panel in which i have to change the css of one column depending upon the value of another column value then how to do it i cannot use renderer function because it works on onload is there any other way i am attaching code in which i have gender column and id column so when gender column select male then background colour of ID should change to Pink colour else not so how to do it. { id: 'value', name: 'value', header: 'Gender', dataIndex: 'insured', width: 100,

Extjs Grid panel one column background Color change on another column value

谁说胖子不能爱 提交于 2019-12-02 04:25:58
I have an Extjs Editor Grid panel in which i have to change the css of one column depending upon the value of another column value then how to do it i cannot use renderer function because it works on onload is there any other way i am attaching code in which i have gender column and id column so when gender column select male then background colour of ID should change to Pink colour else not so how to do it. { id: 'value', name: 'value', header: 'Gender', dataIndex: 'insured', width: 100, editor: new fm.ComboBox({ typeAhead: true, displayField: 'gender', mode: 'local', transform: 'gender',

extjs 3.3: floating panel

谁说胖子不能爱 提交于 2019-12-02 02:56:59
问题 I am trying to create a floating panel over other pre-created panels, I tried following simple codes, but failed: var testPanel = new Ext.Panel({ id: 'testP', width: 50, height: 100, floating: true, title:'Test' }); testPanel.show(); what else I need to think about? thanks! 回答1: Following needs to be taken care of when using the floating config: 1) Fixed width - which you've done 2) The position must be set explicitly after render (e.g., myPanel.setPosition(100,100); ). You can also set the

extjs 3.3: floating panel

早过忘川 提交于 2019-12-01 22:49:07
I am trying to create a floating panel over other pre-created panels, I tried following simple codes, but failed: var testPanel = new Ext.Panel({ id: 'testP', width: 50, height: 100, floating: true, title:'Test' }); testPanel.show(); what else I need to think about? thanks! Following needs to be taken care of when using the floating config: 1) Fixed width - which you've done 2) The position must be set explicitly after render (e.g., myPanel.setPosition(100,100); ). You can also set the underlying Ext.Layer config option instead of just setting floating : true . You can do that in the following

How to add an ExtJs component at a specific position (index)?

风流意气都作罢 提交于 2019-11-30 12:44:35
I have a ToolBar with some components (TextFields and Buttons) and I would like to dynamically add a component (TextField, for example) before the other components. I tried tbBar.add(myComponent); without success. Any idea? Stefan Gehrig You can use Ext.container.AbstractContainer.insert : tbBar.insert(0, myComponent); As an additional information, you can use " Ext.container.AbstractContainer.container.items .indexOf" to get an index of a specific item in your container. var index = container.items.indexOf(component); container.insert(index, newComponent); 来源: https://stackoverflow.com

ExtJS (JavaScript) Module Design Pattern best practices

狂风中的少年 提交于 2019-11-30 08:47:24
I have a question about best practices with the Module Design Pattern. The code below is an example of the way that some of our Components are written (we use ExtJs but that shouldn't matter too much). We build a lot of our components like this and I know that this doesn't match best practices exactly. Have any thoughts to clean up the code? Ext.ns("TEAM.COMPONENT"); function Foo() { // Private vars var privateNumber=0, myButton, privateInternalObject; var numberField = new Ext.form.NumberField({ label : 'A NumberField!', listeners : { 'change' : function(theTextField, newVal, oldVal) {

File download a byte array as a file in javascript / Extjs

放肆的年华 提交于 2019-11-30 05:04:00
In my Ext Js solution I am calling a service which is returning this JSON format {"success":true,"filename":"spreadsheet.xlsx","file":[80,75,3,4,20,0,...(many more)]} How can I make a file download dialog with the filename and the content of the byte array (file) ? UPDATE So I found this bit to start the downlaod var a = window.document.createElement('a'); a.href = window.URL.createObjectURL(new Blob(data.file, { type: 'application/octet-stream' })); a.download = data.filename; // Append anchor to body. document.body.appendChild(a) a.click(); // Remove anchor from body document.body

Better way to call superclass method in ExtJS

感情迁移 提交于 2019-11-29 22:57:47
All the ExtJS documentation and examples I have read suggest calling superclass methods like this: MyApp.MyPanel = Ext.extend(Ext.Panel, { initComponent: function() { // do something MyPanel specific here... MyApp.MyPanel.superclass.initComponent.call(this); } }); I have been using this pattern for quite some time and the main problem is, that when you rename your class then you also have to change all the calls to superclass methods. That's quite inconvenient, often I will forget and then I have to track down strange errors. But reading the source of Ext.extend() I discovered, that instead I

How to add an ExtJs component at a specific position (index)?

限于喜欢 提交于 2019-11-29 18:25:43
问题 I have a ToolBar with some components (TextFields and Buttons) and I would like to dynamically add a component (TextField, for example) before the other components. I tried tbBar.add(myComponent); without success. Any idea? 回答1: You can use Ext.container.AbstractContainer.insert: tbBar.insert(0, myComponent); 回答2: As an additional information, you can use "Ext.container.AbstractContainer.container.items.indexOf" to get an index of a specific item in your container. var index = container.items