-
16 Aug 2009 9:03 AM #21
btw - i really like the $(), so this can be done also:
var $ = Ext.select;
Why isn't that used in ExtJS? Many newcomers know that from the other libraries.vg Steffen
--------------------------------------
Release Manager of TYPO3 4.5
energlobe.de - german online magazine
-
16 Aug 2009 12:42 PM #22Sencha - Ext JS Dev Team
- Join Date
- Mar 2007
- Location
- Notts/Redwood City
- Posts
- 30,458
- Vote Rating
- 20
- Answers
- 9
That's good. What about maintaining functional parity with jQuery with those other things? nextAll and andSelf were pretty easy to add in. If there are any others, they could go in too.
I also think the ability to add pseudos should be highlighted in the "textual" Core Manual.
The following is an intuitive way of selecting external links:
Code:Ext.select("a:external");Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
20 Aug 2009 9:48 AM #23
How to remove all classes from body (for example) in Ext?PHP Code:$('body').removeClass();
-
20 Aug 2009 1:16 PM #24Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 4
- Answers
- 28
-
30 Aug 2009 10:36 AM #25
Remove an event handler
Remove an event handler
How to remove (unbind) the event handler in Ext?PHP Code:$(document).ready(function() {
$('#switcher').click(function(event) {
if (!$(event.target).is('.button')) {
$('#switcher .button').toggleClass('hidden');
}
});
$('#switcher-narrow, #switcher-large').click(function() {
$('#switcher').unbind('click');
});
});
This code doesn't work:
PHP Code:Ext.select('#switcher').un('click', this.handlerFn);
-
30 Aug 2009 12:02 PM #26Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Haarlem, Netherlands
- Posts
- 1,235
- Vote Rating
- 4
- Answers
- 28
PHP Code:Ext.onReady(function() {
var handlerFn = function(ev) {
if (!ev.getTarget('.button')) {
Ext.select('.button', 'switcher').toggleClass('hidden');
}
}
Ext.fly('switcher').on('click', handlerFn);
Ext.select('#switcher-narrow, #switcher-large').on('click', function() {
Ext.fly('switcher').un('click', handlerFn);
});
});
-
31 Aug 2009 4:28 AM #27
Event Namespacing
Event Namespacing
Thank you. What about Event Namespacing to manage specific event handlers?
PHP Code:$(document).ready(function() {
$('#switcher').bind('click.collapse', function(event) {
if (!$(event.target).is('.button')) {
$('#switcher .button').toggleClass('hidden');
}
});
$('#switcher-narrow, #switcher-large').click(function() {
$('#switcher').unbind('click.collapse');
});
});
-
31 Aug 2009 11:47 AM #28Sencha - Ext JS Dev Team
- Join Date
- Mar 2007
- Location
- Notts/Redwood City
- Posts
- 30,458
- Vote Rating
- 20
- Answers
- 9
What does using an event name like "click.collapse" mean?
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
31 Aug 2009 2:16 PM #29
jQuery uses event namespaces to filter bindings. Event namespaces work like this: ("type.namespace"). This link explains it: http://www.learningjquery.com/2007/0...ce-your-events
I haven't personally had a situation where this functionality is useful.
-
31 Aug 2009 11:12 PM #30
The .collapse suffix is invisible to the event handling system. The addition of the namespace means that you can unbind just this handler. Event namespacing is especially handy in the creation of plugins.


Reply With Quote

