extjs

How to fit gridPanels columns?

跟風遠走 提交于 2020-01-23 07:06:24
问题 I have application using ExtJs 3.4. I have this construction: westPanel-TabPanel: var westPanel = new Ext.TabPanel({ id: "west", //xtype: "tabpanel", //layout:'fit', activeTab: 0, region: "west", border: false, width: 278, split: true, collapseMode: "mini", items: [mapList,structure,cadastr,search] }); Search - FormPanel: var search = new Ext.FormPanel({ labelAlign: 'top', frame:true, title: 'Поиск', bodyStyle:'padding:5px 5px 0', //width: 600, //layout:'fit', items: [{ xtype:'textfield',

How to fit gridPanels columns?

半城伤御伤魂 提交于 2020-01-23 07:04:51
问题 I have application using ExtJs 3.4. I have this construction: westPanel-TabPanel: var westPanel = new Ext.TabPanel({ id: "west", //xtype: "tabpanel", //layout:'fit', activeTab: 0, region: "west", border: false, width: 278, split: true, collapseMode: "mini", items: [mapList,structure,cadastr,search] }); Search - FormPanel: var search = new Ext.FormPanel({ labelAlign: 'top', frame:true, title: 'Поиск', bodyStyle:'padding:5px 5px 0', //width: 600, //layout:'fit', items: [{ xtype:'textfield',

How to open first item of multifield on load of dialog?

穿精又带淫゛_ 提交于 2020-01-23 03:14:25
问题 I need to open first item of multifield on dialog load. I looked at the API documentation of multifield but not able to find. <promo jcr:primaryType="cq:Widget" fieldLabel="abcd" hideLabel="false" itemId="abcd" name="./abcd" xtype="[multifield]"> <fieldConfig jcr:primaryType="cq:Widget" hideLabel="false" layout="form" name="./abcd" title="abcd Item Info" xtype="customPanel"> <items jcr:primaryType="cq:WidgetCollection"> </items> </fieldConfig> </promo> Please suggest. 回答1: You can listen to

How to configure ExtJS 4 Store (proxy and reader) to read metadata

╄→гoц情女王★ 提交于 2020-01-22 05:55:06
问题 My question is how to get metadata besides totalRecords, in my case it is version, code, searchquery (please look at json). { "result": { "version":"1", "code":"200", "searchquery": "false", "totalRecords": "2", "account":[ { "lastname": "Ivanoff", "firstname": "Ivan", "accountId":"1" }, { "lastname": "Smirnoff", "firstname": "Ivan", "accountId":"2" } ] } } Here is my model: Ext.define("test.Account", { extend: "Ext.data.Model", fields: [ {name: 'accountId', type: 'string'}, {name: 'lastname'

Best way to hide/disable GUI elements based on user's privilege?

南笙酒味 提交于 2020-01-22 05:06:09
问题 I am starting a web application with client side implemented in pure ExtJS and middle tier in Grails. The application has role-based authorization, where a user can have many fine grained roles like SOME_FORM_READ, SOME_FORM_UPDATE, SOME_DATA_DELETE, SOME_DATA_READ, etc. Based on the roles of the user, certain GUI elements need to be disabled or hidden, while others need to be in a read-only mode. I did some search on the web, but didn't find any design pattern that specifically addresses

Custom Edit control inside a ExtJS Editor grid

穿精又带淫゛_ 提交于 2020-01-21 23:44:07
问题 Got an issue, and need your advices I just started writing an editor grid. (I will actually use this grid as a search filter editor, i.e. columns with criteria name, operators and values). Now, for the value field, I want to have different edit controls for different rows. For instance, when a criteria type is string I want to display a text box, when it's date time, I want a datetime editor. So the fact is, I need to control the "edit control creation/display" just before editing starts. and

How sets z-index to Ext.Panel (ExtJS)?

≯℡__Kan透↙ 提交于 2020-01-20 05:03:05
问题 I have problem with z-index (i think) in ExtJS. While drag and drop element from GridPanel to DataView I drop element over GridPanel and it dropped to DataView. But DataView have place under the GridPanel, and this imposible! Thx! (problem in all browsers) 回答1: Have you tried setting the z-index of your item to a higher order? ie. Ext.Msg.show({ title:'Request Failed', msg:"Error, The request was not found in the database", icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK }); Ext.MessageBox

Convert string to new Date object in UTC timeZONE

若如初见. 提交于 2020-01-17 18:10:11
问题 Can anyone let me know how to convert a string to a date Object with UTC time zone in ExtJs? String is "2015-10-07T23:59:00" . I would like to get the same in Date Object without changing the timezone. 回答1: First of all, your date string does not have a timezone. When you make a JavaScript date object from a string, there are two possible outcomes you could expect: You may want the date to be 23:59 Local (23:59 CEST in my case). In this case, you want to use new Date("2015-10-07 23:59:00")

How to get object of component by its name?

佐手、 提交于 2020-01-17 11:35:11
问题 I have a view like: tbar: [ { iconCls:'icon-p', hidden: true, name:'p', handler:'onPClick' }, { xtype: 'tbfill' }, { iconCls:'icon-n', hidden:true, name: 'n', handler:'onNClick' } ], initComponent: function(){ Ext.apply(this, { layout: 'fit', items: [ { xtype:'textareafield', name: 'name_content' } ] }); this.callParent(); } OnPClick I am doing form.up('id').getForm(). How to get Object of icon-p by its name show that I can hide or show that icon. 回答1: In the onPClick handler you get the

Composite models (models within models), or manual foreign key associations between models?

旧城冷巷雨未停 提交于 2020-01-17 07:56:21
问题 I have two models, and I want to "nest" one within the other. Is there a way to do this with Sencha Touch? My models look like this: Ext.regModel('OuterModel', { fields: ['name'] }); var outerStore = new Ext.data.Store({ model: 'OuterModel', data: [ {name: 'item1'}, {name: 'item2'} ] }); Ext.regModel('InnerModel', { fields: ['a', 'b'] }); var innerStore = new Ext.data.Store({ model: 'InnerModel', data: [ {a: 1, b: 5}, {a: 2, b: 5}, {a: 3, b: 3} ] }); Each OuterModel needs an associated