extjs

ExtJS : handling browser exit event (click on cross-exit)

一曲冷凌霜 提交于 2019-12-30 00:54:07
问题 I would like to know if there is any way to handle the browser exit event. For example, I would like to send a query when the user click on the cross-exit or simply close his browser. 回答1: This thread might shed some insight: http://forums.devarticles.com/javascript-development-22/how-to-stop-browser-from-closing-using-javascript-8458.html I haven't given this solution a test-run yet. But it seems possible. Here's a more in-depth discussion on the onbeforeunload event handler. http://bytes

Better way to call superclass method in ExtJS

我的梦境 提交于 2019-12-29 16:33:07
问题 All the ExtJS documentation and examples I have read suggest calling superclass methods like this: MyApp.MyPanel = Ext.extend(Ext.Panel, { initComponent: function() { // do something MyPanel specific here... MyApp.MyPanel.superclass.initComponent.call(this); } }); I have been using this pattern for quite some time and the main problem is, that when you rename your class then you also have to change all the calls to superclass methods. That's quite inconvenient, often I will forget and then I

Steps to overriding Sencha ExtJS standard component functionality (Ext.tree.Panel & Ext.data.TreeStore as two examples)

早过忘川 提交于 2019-12-29 14:57:14
问题 Suppose I am extending a standard Sencha ExtJS 4 widget/component, and I found a bunch of things that don't work the way I want them to, or perhaps they are just broken and Sencha hasn't gotten around to fixing the issues with the component yet. I'm just going to use the Sencha ExtJS Ext.tree.Panel and Ext.tree.Store as two example components. What are the most basic steps to overriding the constructor, configs, properties, methods and events so I can find and fix the issues with that

Why isn't my ExtJS Store Association Working

…衆ロ難τιáo~ 提交于 2019-12-29 11:40:10
问题 I'm having issues. I want to use the nice ExtJS associations, but they're not working properly. Issues: no association showing in the model no data showing up after load What are the quirks to watch out for? 回答1: I recently went through a very painful learning curve with the ExtJS associations, and came across some useful articles, as well as my own gotchas. Here is the summary for those who run into the same pains. Rules for HasMany Associations in ExtJS Always put your Proxies in your

“Debugging” ExtJS script

天涯浪子 提交于 2019-12-29 09:17:21
问题 Are there any particular tools available for "Debugging" ExtJS script ? Especially, I findi it difficult to debug when the screen goes blank.! 回答1: Aptana Studio is optimised for Javascript development, including debug support for Firefox and IE, it even supports type-ahead on the Ext JS library (you might have to download some eclipse plugins separately). Ext JS comes included with a debugging console (you need to add debug.js and call Ext.log("blah") to bring it up), this will provide

ExtJS 4 Best way to select an element

筅森魡賤 提交于 2019-12-29 08:08:30
问题 In the code (I use MVC model if it matters), to get a specific elements, I use refs. refs: [ { ref: 'window', selector: 'windowName' }, { ref: 'windowButton', selector: 'windowName button[name=buttonName]' }, { ref: 'windowCombo', selector: 'windowName combo[name=comboName]' } ] Is this the right choice to get an elements? Or I have to use getCmp() or something else? 回答1: Here are some tips on targeting a component in an app. First of all be very careful using IDs on the components. I have

ExtJS 4 and its new MVC: grid: how to handle keys?

℡╲_俬逩灬. 提交于 2019-12-29 07:16:21
问题 I'm looking for a way to handle the key in the Grid. I've closely followed the examples here: http://www.sencha.com/learn/architecting-your-app-in-ext-js-4-part-1 http://www.sencha.com/learn/architecting-your-app-in-ext-js-4-part-2 http://www.sencha.com/learn/the-mvc-application-architecture/ So now everything works fine, but I'd like to handle keys in my Grid. So I guess in the declaration " this.control({}) " I should just add another event concerning userlist but it seems Grid don't have

Extjs 4 MVC loading a view from controller

假如想象 提交于 2019-12-28 05:11:51
问题 Ok so I have a controller with a method in which I want to load a view. How do I load a view from a controller? How do I pass some parameters from the controller to the view when I load it? Any help is much appreciated. 回答1: To load a view, you can use Ext.widget() . Use Ext.define() to create a view in your view file. I would recommend using the alias property to define an inline xtype for the view. When you need to load the view, you create an view using Ext.widget() and specify the xtype

How to stop a setTimeout loop?

十年热恋 提交于 2019-12-27 11:50:58
问题 I'm trying to build a loading indicator with a image sprite and I came up with this function function setBgPosition() { var c = 0; var numbers = [0, -120, -240, -360, -480, -600, -720]; function run() { Ext.get('common-spinner').setStyle('background-position', numbers[c++] + 'px 0px'); if (c<numbers.length) { setTimeout(run, 200); }else { setBgPosition(); } } setTimeout(run, 200); } so the out put is looks like this http://jsfiddle.net/TTkre/ I had to use setBgPosition(); inside else to keep

How to stop a setTimeout loop?

北城余情 提交于 2019-12-27 11:47:40
问题 I'm trying to build a loading indicator with a image sprite and I came up with this function function setBgPosition() { var c = 0; var numbers = [0, -120, -240, -360, -480, -600, -720]; function run() { Ext.get('common-spinner').setStyle('background-position', numbers[c++] + 'px 0px'); if (c<numbers.length) { setTimeout(run, 200); }else { setBgPosition(); } } setTimeout(run, 200); } so the out put is looks like this http://jsfiddle.net/TTkre/ I had to use setBgPosition(); inside else to keep