extjs

How to get/list all field names of a JSON data with ExtJS?

半城伤御伤魂 提交于 2019-12-24 11:51:00
问题 I have this json data: [ {"ID":"1","name":"google","IP":"69.5.33.22","active":"true"}, {"ID":"2","name":"bing","IP":"70.5.232.33","active":"false"} ] I want to get the all property names (?), like: name,ID,IP,active Note: I don't mind what is there at "name" and "IP" like google, 70.5.232.33, etc. Just, I want to get the fields itself. 回答1: var jsonString = [ {"ID":"1","name":"google","IP":"69.5.33.22","active":"true"}, {"ID":"2","name":"bing","IP":"70.5.232.33","active":"false"} ]; var

Adding mousewheel to Sencha Desktop App

梦想的初衷 提交于 2019-12-24 11:45:01
问题 So the supposed advantage to using Sencha is being able to have 1 code base for multiple platforms. I have a project I need to be on iOS, Android, PC, and Mac. I have found that I can use Sencha Touch to build to mobile devices and those handle finger swipe events automatically. The problem I have encountered is when I am building a desktop app then it doesn't respond to my mousewheel. I have been on the Sencha forums and this question is unanswered in one place, and in another they promised

How to get rowIndex in extjs widget column

独自空忆成欢 提交于 2019-12-24 11:27:43
问题 I need a button in a widget column to know its rowIndex in an ExtJS 6 panel.grid, so that on button click it can use that functionality. I know I can pull that information from the renderer function, but that seems to execute before the button has been created. Any ideas on how I can get the index? 回答1: Use indexOf on the gridview . You need to pass it the node as argument, which is the HTML element representing the row. In Ext JS 6, grid rows are HTML tables, so the button's row element can

Sencha ExtJS Submit two values

一个人想着一个人 提交于 2019-12-24 11:04:09
问题 I have the below combobox code. Based on what user enters as first two characters I pull out some options through Ajax request and have user select one. The problem is right now I set it to send "fieldValue1.'|'.fieldValue2" values of the field with | separator in between. I want to know if there's a way to send fieldValue1 and fieldValue2 separately without requiring to do a separator? xtype: 'combo', autoLoad: true, hideTrigger: true, fieldLabel: 'Product', displayField: 'Description',

getting extjs and cakephp associated models to work together

为君一笑 提交于 2019-12-24 10:56:48
问题 When I do a find('all') in cakephp with model associations, the format the data is returned in is similar to this: { data: [ { 'mainModel': {}, 'associatedModel1': {}, 'associatedModel2': {}, 'associatedModel3': {}, 'associatedModel4': {} }, { 'mainModel': {}, 'associatedModel1': {}, 'associatedModel2': {}, 'associatedModel3': {}, 'associatedModel4': {} } ] } when I write a store in ExtJS, I would need to set the record config option to mainModel , but then how would the associations work? As

Hide Expand/Collapse button in Grid panel Group Header

心已入冬 提交于 2019-12-24 10:29:09
问题 In my grid I would like to retain the grouping feature along with a groupHeaderTpl (Currently showing some custom text in the headers) , but I want to hide the [+/-] button from the header. I tried it with CSS styles but without success. Can somebody help me to achieve this? 回答1: Implement the collapsible property like this features: [{ftype:'grouping', collapsible : false}] 来源: https://stackoverflow.com/questions/13354547/hide-expand-collapse-button-in-grid-panel-group-header

Customize the Loader for a MVC App

你。 提交于 2019-12-24 10:16:22
问题 I need to use a customize path for the Ext.Loader in my MVC project. I've already looked through the API and found nothing useable. If I set the loader directly it gets simply overriden, as it seems by the MVC app settings. So how can I customize the loader path for a MVC app? In addition: It would be awesome if the loader could be tweaked to sumarize multiple requirements that occours by the same source into one request. Would that be possible? Thanks in advance for any suggestions Edit The

rowedit grid with sync

落爺英雄遲暮 提交于 2019-12-24 10:14:01
问题 I try to implement a general rowediting grid like this example, with the difference that I would like to sync the changes with the server backend. Until now, I can add a new line with onRoweditAdd . Ext.define('Mb.view.base.RoweditListController', { extend: 'Ext.app.ViewController', alias: 'controller.roweditlist', onRoweditAdd: function(me){ var grid = me.up('panel'), edit = grid.editingPlugin, store = grid.getStore(), record = store.getModel().create({id: 0}); edit.cancelEdit() store.insert

Singleton Pattern and Abstraction in JS

旧时模样 提交于 2019-12-24 09:57:59
问题 Although the example below exploits ExtJS, one can easily extrapolate to another framework. I am a fan of abstraction and data hiding (and OO in general); does anyone else hide data and members/functions or do you consider this attempt to be overkill? (Note: I believe strongly that DOM IDs should almost never be hardcoded. And, though I use prototypes for public methods of typical classes, you will notice a public function below created outside of the prototype.) This note is interesting http

Declaring Default Values in Config

穿精又带淫゛_ 提交于 2019-12-24 09:38:24
问题 I have a situation where I have a number of components in a column layout with alternating width, ie .75 then .25 . Ext.define('MyApp.view.TestView', { extend: 'Ext.panel.Panel', layout: 'column', items: [{ xtype: 'textfield', columnWidth: .75 }, { xtype: 'textfield', columnWidth: .25, }, { xtype: 'textfield', columnWidth: .75 }, { xtype: 'textfield', columnWidth: .25, }, { xtype: 'textfield', columnWidth: .75 }, { xtype: 'textfield', columnWidth: .25, } ] }); Ext.onReady(function() { Ext