extjs

How do I disable a control in an ExtJS grid?

人走茶凉 提交于 2019-12-13 15:24:57
问题 I am using ExtJs 3.4. I have a checkbox control in an ExtJs Grid. I want to disable the checkbox control based on when a value in the store is equal to zero. I have tried this and it does not disable it: var colModel = new Ext.grid.ColumnModel( { columns: [ { id: 'AircraftOid', header: "AircraftOid", width: 100, sortable: true, locked: true, dataIndex: 'AircraftOid', hidden: true }, { id: 'nNumber', header: "N-#", width: 100, sortable: true, locked: true, dataIndex: 'NNumber' }, { header:

How to have the slide multiple screens in Sench touch

匆匆过客 提交于 2019-12-13 15:22:37
问题 I am developing an application in which when submit button is clicked in the form, it should go to a different screen. However it is just printing the results outside of the window and not really going to a new screen. I have hardcoded the store to make sure there is data when I start the application and it still prints it outside of the viewable area. Here is my Ext.data.Store: var store = new Ext.data.Store({ model: 'jobSummary', storeId: 'jobStore', data : [{title: 'This is test'}, {title:

How to set url and root dynamically in extjs

半城伤御伤魂 提交于 2019-12-13 15:21:05
问题 Can anybody tell how to set the url and root of a store dynamically in Ext JS? I have created a store like the one below. I need to update the root and dynamically set the url inside a controller. Ext.define('Test.store.TestStore', { extend: 'Ext.data.Store', model: 'Test.model.TestModel', storeId: 'testStore', proxy: { type: 'jsonp', reader: { type: 'json', root: 'responseXML' } } }); Thanks 回答1: You can set the proxy's url later in your code this way: store.getProxy().url = '/your/url';

Is there an example of setting and retrieving settings from a Rally SDK 2 app?

扶醉桌前 提交于 2019-12-13 15:18:04
问题 What does a settings object look like? I can't seem to updateSettings with anything and get something back interesting. I'm printing out this.settings and every time I refresh, it just logs a prototype object with no values. This is what my test app looks like. I am putting it into a panel inside Rally, not running remotely. <script type="text/javascript" src="/apps/2.0p2/sdk.js"></script> <script type="text/javascript"> Rally.onReady(function() { /*global console, Ext */ Ext.define(

File upload field is reset when submit form

巧了我就是萌 提交于 2019-12-13 14:51:50
问题 I am using ExtJS version 4.1.1. I try to create upload file form using filefield as follow: { xtype: 'filefield', itemId : 'my-file', name: 'my file', emptyText : 'No file chosen', fieldLabel: 'Upload File', submitValue: true, allowBlank : false, buttonText: 'Browse', listeners: { change: function(fld, value) { var newValue = value.replace(/C:\\fakepath\\/g, ''); fld.setRawValue(newValue); } } } When the form is submitted, the filefield is reset. As I see in http://www.sencha.com/forum

Extjs4, How to set displayField in combo editor?

徘徊边缘 提交于 2019-12-13 14:18:21
问题 In combo editor, after select a option, it display value even I set display Field. Once I click the combo editor, it will display displayField as well, but after select and click the others (It means mouse out) then the cell value changed to valueField. my combo editor code, { xtype : 'combo', editable : false, triggerAction : 'all', displayField : 'name', valueField : 'id', store : myStore } what I missed? anyone know, please advice me~ Thanks! [Edit] I write test code in here : http:/

ExtJS alias vs id

天涯浪子 提交于 2019-12-13 13:49:55
问题 I don't understand the usage of alias vs id vs itemId config properties in ExtJS app/view/foo.js Ext.define('app.view.foo', { ... alias: 'widget.foo', // 1 id: 'foo', // or 2 ... }); app/controller/goo.js Ext.define('app.controller.goo', { ... views: ['foo', ...], init: function() { this.control({ 'foo': {...}, // 1 '#foo': {...} // or 2 ... }); ... }, ... }); With alias I can use xtype easily.. but what advantage do I gain by setting id 's to my views? 回答1: An alias is set on the class

Remove ability to select specific rows in grid ExtJS 4

人走茶凉 提交于 2019-12-13 13:11:21
问题 I have to remove ability to select some rows in my grid. I use CheckboxModel selModel: Ext.create( 'Ext.selection.CheckboxModel', { mode: 'SIMPLE' } ) To disable selection I use beforeselect event beforeselect: function ( row, model, index ) { if ( model.data.id == '3' ) { return false; } } And to hide checkbox I use specific class for row and css rule viewConfig: { getRowClass: function( record, index ) { var id = record.get('id'); return id == '3' ? 'general-rule' : ''; } } .general-rule .x

Render customize component inside XTemplate

白昼怎懂夜的黑 提交于 2019-12-13 12:23:01
问题 Ext.define('GB.view.DigestList',{ extend: 'Ext.panel.Panel', alias:'widget.digestlist', items:[ { xtype:'dataview', store: 'GB.store.Digests', tpl: new Ext.XTemplate( '<tpl for=".">', '<div class="container">', '{name}', '<div class="davidfun"></div>', '</div>', '</tpl>' ), listeners: { viewready: function(){ var home_d = Ext.create('GB.view.MyOwnDigest'); home_d.render(Ext.query('.davidfun')[0]); // home_d.render(Ext.getBody()); <- it'll work fine with this line }, } }], bind: function

Changing images after selecting ExtJs

自古美人都是妖i 提交于 2019-12-13 10:27:53
问题 How can I preview images in ExtJs ? I mean, I am using FileUploadField and I want to select an image and set a place to show the image selected in my form. 回答1: You will need to handle file upload field's event to read event and retrieve image as data URL and set it manually to image component. Here is working code to achieve this with ExtJS 5.x: Ext.application({ name: 'Fiddle', launch: function () { Ext.create('Ext.panel.Panel', { renderTo: Ext.getBody(), title: "FileUpload Filed with Image