English 中文(简体)
父母与ExtJS4的成分?
原标题:ComponentQuery for a parent with ExtJS4?

是否有办法询问“什么”? 在一个部分中,我很乐,希望对家长活动的听众进行登记。 这要求我获得我主要观点的亲子。

最佳回答

In ExtJS4, you can use up() from an Ext Element.

The params are a string of the parent element you wish to find e.g:

var parentEl = Ext.get( childID ).up( div.parentClass ); 

如果你提供一些有关贵构成部分/单位结构的细节,我可以举出一个应该合适的具体例子。

EDIT: To show going up from a component

var myComponent = // however you ve got it

var theParentEl = myComponent.getEl().up( div.parentClass );
问题回答

通常up( PARENTCLASS )就足以使你重新努力做到。 这里是我对守则所做的一切,这样一些要素就产生了它们的形式:

items: [
...
   { xtype:  checkbox , listeners: {
      change: function() { this.up( window ).fireEvent( checkboxchanged ); }
   }}
...
]

As I understand, you want to listen to events dispatched by a component s parent from the child component s controller control function specifically.

There is not a query selector like parent < component which you can put in the child controller s control function to listen to parent events.

通常,我只想向儿童控制员补充家长的看法,然后,你可以听听听听听听听会。 但是,我假定你没有这样做,因为你试图向不同的控制者或某些人下放权力。

You could fire an event in the child component whenever that parent event occurs. Inside the parent controller you could do it like this:

var child = parent.down( child );
child.fireEvent( myOwnEventName , arg1, arg2, arg3, etc);

然后,你将给我增加一个手稿。 • 担任儿童控制员的控制职务,以掌握你想要的逻辑。

如果父母没有控制人,那么你就应该把母子成分作为孩子控制者的一种观点。





相关问题
How to use JSON without json file?

I need to use dynamically JSON with data.TreeStore. With this component, there is proxy "config", it need a path to JSON file. My problem is, i can t write Json file in my application. I would know, ...

Dynamic Model with ExtJS 4

With ExtJS 3.x, I was able to use the "fields" property of a Store, but it seems with ExtJS 4 I have to absolutely use a Model. It s fine, but in my case, it s not a static Model, and I need to define ...

TreeNode click event on ExtJs 4

I m using ExtJS 4 (beta 3) and I have a TreePanel that is my kind of navigation menu. It is something like this: Jobs Add Job List All Jobs ... ... ... (this will be made on a permission system ...

Ext.loader not enabled Missing required?

I have some problems with Extjs4 librairie. I want to use treeEditor component. Firebug error : Error : uncaught exception: Ext.Loader is not enabled, so dependencies cannot be resolved ...

how to make a "MVC Application" with extjs 4.0 beta 3?

Is there someone here who made a MVC application using EXTJS 4 BETA 3? and works fine?? please help me how?, .. I have followed step by step here .. and @Abdel Olakara help but there is still an ...

Object function has no method defer

I m try to render a progress bar in grid (Ext JS), and get this error: Object function has no method defer What is this "magical" method? What does it do? And why is it not found? Code: renderer:...

热门标签