extjs4

Difference between column and hBox layout

余生颓废 提交于 2019-12-24 02:50:35
问题 As far as I can tell, the hBox layout in extJS seems kind of redundant. This layout would make the first element 25%, and the second 75% layout: { type: 'hbox' align : 'stretch', pack : 'start', }, items: [ {html:'a', flex:1}, {html:'b', flex:3} ] But I could just as easily do this with a column layout like so : layout:'column', items: [ {html: 'a', columnWidth: .25}, {html: 'b',columnWidth: .75} ] What is the purpose of the hbox layout? 回答1: The hbox layout have more configs. but the column

Reconfiguring grid columns in ExtJs4 - SelModel disappears?

北城余情 提交于 2019-12-24 02:18:14
问题 I am defining a grid which has a selModel . Each time the store loads, the grids columns are dynamically reconfigured using the grids Reconfigure method. However when I do this the grids selModel disappears. How can I reconfigure the grids columns to also include the selModel. Below is some example code: //The Selection Model for the grid. var sm = new Ext.selection.CheckboxModel(); //The Grid var grid = new Ext.grid.Panel({ store: store, selModel: sm, columns:[{ header: 'Loading ...' }] });

select row only when checkbox is clicked ExtjS 4

南笙酒味 提交于 2019-12-24 00:46:10
问题 In an ExtJS 4.1 grid that uses CheckboxModel as a selection model, when you click on an entire row, that row is selected (and the corresponding checkbox is checked). Is there a way that I can prevent that default behaviour from happening and permit row selection only when the checkbox for a corresponding row is clicked (as opposed to when clicking the entire row)? Again I'm using ExtJS version 4.1 Thanks for any help Note: My grid also has the CellEditing plugin attached to it. I don't want

Is there any way to disable nodes of treeview in ExtJS 4

半城伤御伤魂 提交于 2019-12-23 19:17:43
问题 My purpose is to disable certain nodes of treeview in the west region. The below snippet shows it: root: { expanded: true, id: 'treeview1', children: [ {"text": "Make Copy", "leaf": true, id:'HS1', "**disabled**": true, "**hidden**" : true} ] } Why does the disabled and hidden property doesn't work in ExtJS 4. Is there any plugin to achieve it. 回答1: The nodes in the treepanels are Ext.data.NodeInterface objects. It doesn't have disabled or hidden properties, but it has cls and with that you

How to determine the selected cell of a Ext.grid.Panel in ExtJS 4?

我只是一个虾纸丫 提交于 2019-12-23 18:05:47
问题 how can i get the selected cell of a Ext.grid.Panel? In ExtJS 3 it was possible via: grid.getSelectionModel().getSelectedCell() In Ext 4 there is grid.getSelectionModel().selected but this only gives me the record. 回答1: There may be a more direct way to do this but the following seems to work for me: grid.view.getCellByPosition(grid.getSelectionModel().getCurrentPosition()); 回答2: I ended up needing the actual column that the user was clicking on and discovered the following: grid.panel

Add Flex value dynamically to controller in extjs

谁说我不能喝 提交于 2019-12-23 16:34:42
问题 I am giving some items (containers), in "View", a layout of hbox . Now I want to give flex value to each item through the "Controller". How can I do this? I have gone through the docs but can't find any method like setFlex . EDIT : Ext.apply(Ext.getCmp('IdHere'), {flex: 1}); I have got the answer from this link. But now the problem is that even I am changing the flex values dynamically, the view of the containers is not changing. It is remaining same. I am not assigning flex values initially

Design sudoku using extjs

坚强是说给别人听的谎言 提交于 2019-12-23 16:34:31
问题 I am very new to extjs. I am trying to design sudoku game using extjs. Till now I have done the following: Ext.onReady(function() { var i = 0, items = [], childItems = []; for (i = 0; i < 9; ++i) { childItems.push({ xtype: 'container', height: 50, style: { borderColor: '#000000', borderStyle: 'solid', borderWidth: '1px', width: '40px' } }); } for (i = 0; i < 9; ++i) { items.push({ xtype: 'container', height: 150, layout: { type: 'column' }, style: { borderColor: '#000000', borderStyle: 'solid

ExtJS and page authorization (server-side)

前提是你 提交于 2019-12-23 10:25:13
问题 I'm looking for information on how to implement secure pages using ExtJS 4. By secure pages I mean the user will log into our website using Siteminder (SSO) and so we will have the user's identity. Then we would determine what roles the user would have by making a database/LDAP call and only render those views/components that the user has access to. Several questions come to mind: 1.) Of course I would expect we would do the authorization check prior to rendering the pages on the server-side,

Access to http status code from Ext.data.Store

假装没事ソ 提交于 2019-12-23 10:21:48
问题 I have an http API which (shockingly new technique) reacts on different errors setting different response statuses. The question is - while using Ext.data.Store with some XMLHttpRequest-inside proxy, what is the best way to handle this statuses? As far as I can understand, "load" event does not pass status directly, as well as "exception", and the last one actually doesn't even trigger when 4** status is received. So, as I can see from code xhr instance is hidden from Ext.data.store, so the

View Reference in Controller EXTJS 4

会有一股神秘感。 提交于 2019-12-23 09:38:53
问题 I am not able to get combobox value in a controller. The getter method of combobox view returns function i(){ return this.constructor.apply(this,arguments)||null } instead of view object instance. If I use var combo=this.getColumnTypeComboView().create() then I don't get selected value of the combobox combo.getValue() . 回答1: To get view reference in a controller simply use getView() method from the Controller class. To create a connection between view and a controller make sure that you