extjs

ExtJS 3: Two ways of creating custom class: what's the difference?

寵の児 提交于 2019-12-21 07:34:01
问题 I'm trying to learn ExtJS and object-oriented JavaScript in general. I've seen people defining classes in custom namespaces in a couple of ways. What's the difference between these two methods? Method 1 Ext.ns('myapp.cars'); (function(){ var Car = Ext.extend(Object, { //... }) myapp.cars.Car = Car; })() Method 2 Ext.ns('myapp.cars'); myapp.cars.Car = Ext.extend(Object, { //... }); Method 2 is easier to read and requires less code; is there any reason Method 1 is better? Thanks! 回答1: It's

Extjs get all store records

泄露秘密 提交于 2019-12-21 06:59:57
问题 I have one question. Is it possible to get all records which are loaded in a store when the filters are being added to store? For example, if I load into the store 34 records and then apply filters and there is only 15 left, could I get those 34 records without clearing filters? 回答1: Edit: This was originally answered for Ext 4.2, where snapshot was public and documented. It is gone nowadays. So here's an update for Ext 5 and 6. Ext 5 / 6 One liner: var allRecords = (store.getData().getSource

How to find XPath of an ExtJS element with dynamic ID

筅森魡賤 提交于 2019-12-21 06:48:32
问题 All the elements in the application which i am testing have dynanic ID's . The test always passes when i replay it without refreshing the page but as soon as i refresh the page, The Test Fails because Id's of all the elements changes randomly and selenium cannot match the recorded id's with the new ones . I tried to use Xpath-position, It works for some objects but in case of Dropdown list and Buttons , it dosent work! Can anyone please tell me how to find the Xpath (Meathods in JAVA or S*

dynamically set fields to a extjs data store

自作多情 提交于 2019-12-21 05:41:43
问题 I am trying to dynamically set fields to a extjs data store so that I could dynamically create a different grid at run time. Case A works for me. But when I use as in Case B , the store's proxy hangs on to the previous model and so the grid rendering is messed up. What is the really the difference between these two? Case A Ext.define('FDG.store.reading.FDGDynamicGridStore', { extend: 'Ext.data.Store' }); var fdgstore = Ext.create('FDG.store.reading.FDGDynamicGridStore', { fields: fields,

How to update Extjs Progress Bar with JSON results?

时光毁灭记忆、已成空白 提交于 2019-12-21 05:38:10
问题 I am facing some difficulties in getting my progress bar to retrieve its progress from Json results and update the progress bar based on the timer check of every 10 seconds. I am able to create a json result like this: {"success":true, "progress":0.2} I suppose the general idea is that, I need a task with interval set to 10sec, and having the runner to run the task, and when the progress bar starts working, the runner will check on the results from the Json, and update the progress bar as per

ExtJS Data Grid Column renderer to have multiple values

懵懂的女人 提交于 2019-12-21 04:48:26
问题 I am wondering if it is possible in ExtJS to have several values of the data source available to the renderer of the column. For example with the "Actions" column, the id is passed to the renderer. However I require both the user_id and id passed to the render. How may I do this? table_cols = [{ header: "User ID", width: 30, sortable: true, dataIndex: 'user_id' }, { header: "Actions", width: 60, sortable: false, dataIndex: 'id', renderer: function(val) { //IF USER ID MEETS A CONSTRAINT PRINT

How to Delete controller ExtJS?

不想你离开。 提交于 2019-12-21 04:48:06
问题 I dynamically create controllers in my application like this: var loadedController = me.app.getController(controller_name); loadedController.init(); How can I delete this controller after using? Thanks. 回答1: ExtJs currently does not support removal of controllers out of the box. To cleanup a controller, do the following: Extend Ext.app.EventBus with a method uncontrol that unregisters all event listeners that this controller registered on the EventBus. Check out the source of Ext.app.EventBus

ExtJS 4 how to create and display a new controller/view from another controller/view?

旧城冷巷雨未停 提交于 2019-12-21 04:33:37
问题 I have looked over lots of examples of ExtJS 4 MVC, and they all pretty much show the same thing: The application creates a viewport, loads in a view, and has a 'controllers' defined, which init's the controller: Ext.application({ name: 'AM', controllers: [ 'Users' ], launch: function() { Ext.create('Ext.container.Viewport', { layout: 'fit', items: [ { xtype: 'userlist' } ] }); } }); Thats great, but now let's say in my application I want a button contained within my view to open a whole new

How different is Ext JS from others like jQuery and Mootools

对着背影说爱祢 提交于 2019-12-21 04:24:38
问题 When looking at Ext JS, I don't get the feeling that it's meant for the same things as jQuery and Mootools. Whilst jQuery and Mootools help with the general workings of a site, Ext JS seems to be focussed on tables and storing data, plus manipulating it. So, is this observation correct, or is Ext Js fit for the same work as jQuery and Mootools? 回答1: Comparing ExtJs and JQuery is like comparing apples and oranges. You can compare Ext Core to JQuery, and ExtJs to JQuery UI. Ext Core and ExtJs

Extjs create dynamic accordion using store

て烟熏妆下的殇ゞ 提交于 2019-12-21 02:42:10
问题 I'm beginning development of an app in extjs. I'm using the MVC approach, as provided in the extjs documentation. I have some dynamic data which needs to present the user with a set of accordion controls. I've got the data in a store, but I do not know how to dynamically create the accordion items (unlike grid panels, there doesn't appear to be a store data method). Here is my current accordion view code - with static items: Ext.define('BP.view.induction.LeftPage', { extend: 'Ext.Panel',