extjs4

Extjs4 combobox displayValue in grid

假如想象 提交于 2019-12-30 04:58:15
问题 Please, help. I want to show my displayValue in the Grid. I found the solution here, but I can't understand how use it. My code: columns:[...,{ header: 'Product', id: 'combo', locked: true, dataIndex: 'prod_id', editor: { xtype: 'combobox', store: new Ext.data.Store({ fields: ['value','display'], data: prod_list }), displayField: 'display', valueField: 'value' } },...] Solution Ext.util.Format.comboRenderer = function(combo){ return function(value){ var record = combo.findRecord(combo

ExtJS extend grid RowEditor plugin (to edit array)

狂风中的少年 提交于 2019-12-30 01:58:40
问题 I've been using the ExtJS grid row editing plugin pretty liberally for CRUD operations in web applications. Now, I have a requirement to allow a database record to be edited along with a related collection/array (from another datastore) using this row editing plugin. To do this I want to insert drag-n-drop grids inside of a row that has been selected for editing, one grid showing the available (unused) collection items on the left and another grid to hold the defined collection items on the

Steps to overriding Sencha ExtJS standard component functionality (Ext.tree.Panel & Ext.data.TreeStore as two examples)

早过忘川 提交于 2019-12-29 14:57:14
问题 Suppose I am extending a standard Sencha ExtJS 4 widget/component, and I found a bunch of things that don't work the way I want them to, or perhaps they are just broken and Sencha hasn't gotten around to fixing the issues with the component yet. I'm just going to use the Sencha ExtJS Ext.tree.Panel and Ext.tree.Store as two example components. What are the most basic steps to overriding the constructor, configs, properties, methods and events so I can find and fix the issues with that

ExtJS 4 Best way to select an element

筅森魡賤 提交于 2019-12-29 08:08:30
问题 In the code (I use MVC model if it matters), to get a specific elements, I use refs. refs: [ { ref: 'window', selector: 'windowName' }, { ref: 'windowButton', selector: 'windowName button[name=buttonName]' }, { ref: 'windowCombo', selector: 'windowName combo[name=comboName]' } ] Is this the right choice to get an elements? Or I have to use getCmp() or something else? 回答1: Here are some tips on targeting a component in an app. First of all be very careful using IDs on the components. I have

ExtJS 4 and its new MVC: grid: how to handle keys?

℡╲_俬逩灬. 提交于 2019-12-29 07:16:21
问题 I'm looking for a way to handle the key in the Grid. I've closely followed the examples here: http://www.sencha.com/learn/architecting-your-app-in-ext-js-4-part-1 http://www.sencha.com/learn/architecting-your-app-in-ext-js-4-part-2 http://www.sencha.com/learn/the-mvc-application-architecture/ So now everything works fine, but I'd like to handle keys in my Grid. So I guess in the declaration " this.control({}) " I should just add another event concerning userlist but it seems Grid don't have

ExtJS 4 Grid Panel - Spacebar row toggle

我是研究僧i 提交于 2019-12-25 15:15:42
问题 In ExtJS 4, selecting a row in a Grid Panel (by clicking it), and pressing the spacebar selects and de-selects the row. It was not like this in ExtJS 3, and I would like to disable this feature. Any ideas? I've begin looking into Ext.util.KeyMap to see if I could override it somehow. Thanks in advance. 回答1: You have to override the onKeyPress method of the the Ext.selection.RowModel . The shipped implementation is onKeyPress: function(e, t) { if (e.getKey() === e.SPACE) { e.stopEvent(); var

How to set custom folder names for views stores and models on ExtJs 4 application?

懵懂的女人 提交于 2019-12-25 14:11:29
问题 I ask this because there is an existing application that I would like to enable for using Sencha CMD so first step is to instantiate it via: Ext.Application which presents the first problem: folder structure is someApp --Views --Model --Store --moreFolders (should be model, store, view) Rather than refactoring hundreds of classes(huge app) I want to set the folders path if possible. Can you think in any drawbacks? What would your approach be? Any ideas are very well received. Using ExtJs 4.1

How to set custom folder names for views stores and models on ExtJs 4 application?

冷暖自知 提交于 2019-12-25 14:11:13
问题 I ask this because there is an existing application that I would like to enable for using Sencha CMD so first step is to instantiate it via: Ext.Application which presents the first problem: folder structure is someApp --Views --Model --Store --moreFolders (should be model, store, view) Rather than refactoring hundreds of classes(huge app) I want to set the folders path if possible. Can you think in any drawbacks? What would your approach be? Any ideas are very well received. Using ExtJs 4.1

ExtJS 4, keypress event on container

假装没事ソ 提交于 2019-12-25 12:22:07
问题 I'm using ExtJS 4.1 MVC and I need to perform some actions after user click Enter button. I did it this way: Ext.getDoc().on('keypress', function(event, target) { me._enterKeyHandler(event, target, me); }); But I wonder if somehow I can use Ext.util.KeyMap in Container. In Sencha docs I found something and tried, but it didn't work for me. var map = new Ext.util.KeyMap({ // in target I tried: Ext.getCmp('myComponent'), "myComponent", myComponentVar target: "my-element", key: Ext.EventObject

How to get plugin from component using component query on Extjs 4.1?

半世苍凉 提交于 2019-12-25 05:26:07
问题 I want to add event listener to plugin on Controller.like http://docs.sencha.com/ext-js/4-1/#!/api/Ext.app.Controller It seems different to get plugin using component query than normal component. Is it possible to get plugin from component using component query? Here is my component Ext.define('App.view.file.List',{ rootVisible: false, extend:'Ext.tree.Panel', alias:'widget.filelist', viewConfig: { plugins: { ptype: 'treeviewdragdrop', allowParentInsert:true } }, //etc ... Can i get