extjs4.1

Select a value from a variable

和自甴很熟 提交于 2019-12-11 13:04:51
问题 In Extjs, I am trying to select a value accrued from a variable Store . I tried: var newStore = Store.data.items[0].data.accrued; The above one is not working. I am getting error: Uncaught TypeError: Cannot read property 'data' of undefined Whenever I add items[0] , it is making the variable undefined. When I checked: var newStore = Store.data.items.length; output is: 0 //? But I can see that there are items in Store variable here as shown in the above image. Anyway, I just want to get the

Extjs Grid panel - Hide a column with hideable=false

只愿长相守 提交于 2019-12-11 11:14:17
问题 i'm using Extjs 4.1 grid panel. i'm looking for a way to hide a column from the grid. i can use setHidden but then the user can "unhide" the column again from the menu in the column header. it seems that the hideable propery just doesnt cut it... 回答1: Ok. Eventually i did this: in the grid's "afterrender" event: var header = pnl.down("headercontainer"); if(header != null && header["getMenu"] != null) { var menu=header.getMenu(); menu.on('beforeshow',function(sender,eOpts){ var menu=sender; if

Handling the layout dynamically

别等时光非礼了梦想. 提交于 2019-12-11 10:25:14
问题 Below is the code I tried: <script type="text/javascript"> Ext.require(['*']); Ext.onReady(function() { Ext.Loader.setConfig({ enabled: true }); var totalScreenWidth = screen.availWidth; var totalScreenHeight = screen.availHeight; Ext.QuickTips.init(); var viewport = Ext.create('Ext.ViewPort', { id: 'border-example', layout: 'border', items: [ Ext.create('Ext.Component', { region: 'north', height: totalScreenHeight * 0.05, autoEl: { tag: 'div', html: '<p><center>UI Demo</center></p>' } }), {

Ext JS pass extra param to handler

独自空忆成欢 提交于 2019-12-11 06:14:54
问题 I want to pass extra parameter to handler function of messageBox. I've created a context menu like this: onEventContextMenu: function (s, rec, e) { e.stopEvent(); if (!s.ctx) { s.ctx = new Ext.menu.Menu({ items: [{ text: 'Delete event', iconCls: 'icon-delete', scope: this, handler : function() { Ext.MessageBox.show({ title : 'Reason', msg : 'place reason:', width : 300, buttons : Ext.MessageBox.OKCANCEL, multiline : true, fn : this.showResultText(buttonId, text, rec) }); } }] }); } s.ctx.rec

Ext.grid.Panel not loading data from Ext.data.Store

夙愿已清 提交于 2019-12-11 05:57:01
问题 I am trying to populate an ExtJS grid Panel from a Store using the following code : app.js Ext.define('UC', { extend: 'Ext.data.Model', fields: ['PMNumber'] }); var ds = Ext.create('Ext.data.Store', { storeID :'s', model: 'UC', proxy: { type:'ajax', url:'data.php', reader: { type : 'json', root: "myInventory", fields: [ {name: 'PMNumber', type: 'int', mapping: 'PMNumber'}, ] } } }); Ext.onReady(function() { ds.load(); Ext.create('Ext.grid.Panel', { title: 'Attendanace', store: Ext.data

dockedItems - text from Panel

放肆的年华 提交于 2019-12-11 04:54:10
问题 I have Tree panel. everything works!; Ext.define('My.Tree', { extend:'Ext.tree.Panel', id: 'DriveTree', store: storeTree, ChooseButtonText: 'ChooseFolder', dockedItems: [{ xtype: 'toolbar', items: [{ text: 'BUTTON TEXT', // this.ChooseButtonText id:'connectButton', handler: function(){ alert(this.ChooseButtonText); } }, ] }], }); Ext.onReady(function(){ var tree =Ext.create('My.Tree', {}); }); But text of dockedItems want to be from Panel. something like this: text:this.ChooseButtonText each

Printing ExtJS charts with @media print

时间秒杀一切 提交于 2019-12-11 04:42:00
问题 I have a printing solution for ExtJS objects that seems to work great for everything except for charts. I've been using @media print CSS tip to create a "printing" div below my viewport (so it is not seen on screen, but it is the only item that is printed when a user clicks the print button). I do this so that I can control the proportionate sizing of the object so that it fits on the page nicely and so that I can remove "non-printing" elements like toolbars. When I want to print an ExtJS

Create event for arrow keys in extjs

余生长醉 提交于 2019-12-11 04:03:55
问题 How to get the char codes of the arrow keys in extjs? I tried the below code which is working good to get the char codes of all the keyboard buttons but not the arrow keys(also Backspace). Ext.getDoc().on('keypress', function(event, target) { console.log(event.getCharCode()) }); Before asking here, I have gone through the documentation which I can't understand. and also If I press backspace then the page is redirecting to previous page. I am planning to keep my own function in future on

Extjs 4.1 Check Change Listener

谁说我不能喝 提交于 2019-12-11 03:32:52
问题 What is the right way to handle menu check items events ? I have this menu: { xtype: 'button', id: 'types_btn', autoWidth: true, text: 'Types', menu: { xtype: 'menu', frame: true, id: 'types_menue', items: [ { xtype: 'menucheckitem', id: 'f_type', text: 'first', listeners: { checkchange: { fn: me.onFirstButtoncheckchange, scope: me } } }, { xtype: 'menucheckitem', id: 's_type', text: 'second', listeners: { checkchange: { fn: me.onSecondButtoncheckchange, scope: me } } } Then the functions:

Extjs Custom TreeGrid Row CSS

只愿长相守 提交于 2019-12-11 03:11:49
问题 Is there a way to apply Alternative row css on the child level of a tree grid? Currently the stripeRows config on the treePanel viewConfig just makes everything grey and white, but it is difficult to distinguish the child rows from the parent rows. Ideally I'd like to make the parent objects alternate colors one way and the child rows alternate colors another way. I was thinking of writing a function using the "getRowClass" method to manually update the row class. I was wondering if there was