PDA

View Full Version : ????????



pav-pas
27 Sep 2010, 9:47 AM
???????????!!!

?????????? ??? ???????? ?????? ?? ??????, id ???????, ???????? ?????? ??????????,


Object1 = Ext.extend(object, {
initComponent : function() {
Ext.apply(this, Ext.apply(this.initialConfig,
Object2 {
Object3 {
???????? ?????? ?? Object1
?? ? ?????? ????? ???? ???????? ????????, ???????? Object1.getId()
}
}
));
}
}

troseberry
27 Sep 2010, 10:55 AM
You can take a look at the Ext.getCmp or making sure to properly scope the object and then you can access it via Ext.getComponent

Take a look at the following screencast. Might help you out. http://tdg-i.com/392/ext-js-screencast-the-dangers-of-ext-getcmp

pav-pas
27 Sep 2010, 11:03 AM
??? ? ??? ??????, ? ??? ?? ? ???? ? id ??????, ?? ? ????????? ????????, id ??????????? ? ??????? ??...?? ????????, ?????? ??? ?? ??????

pav-pas
27 Sep 2010, 11:16 AM
????? ??? ???????????? ??? ?????? ?????? ???????

troseberry
27 Sep 2010, 11:29 AM
what kind of component are you extending? depending on the scope you can always use "this" as the reference to the object. Can you give a better example since


Object1 = Ext.extend(object, {
initComponent : function() {
Ext.apply(this, Ext.apply(this.initialConfig,
Object2 {
Object3 {
???????? ?????? ?? Object1
?? ? ?????? ????? ???? ???????? ????????, ???????? Object1.getId()
}
}
));
}
}
is not valid syntax.

pav-pas
27 Sep 2010, 11:37 AM
Ext.ns('Application');

Application.z = Ext.extend(Ext.Panel, {

initComponent : function() {

this.D1 = '111';

var config = {items: [

new Ext.grid.GridPanel({

????? ?????? ??? ???? ???????????? ???????? ??????????, ??? ??? ????????
???????? ???????? ???????? this.D1

-----------------------------------
})
]}; // eo config object

Ext.apply(this, Ext.apply(this.initialConfig, config));
Application.z.superclass.initComponent.apply(this, arguments);

});

Ext.reg('z', Application.z);

pav-pas
27 Sep 2010, 11:46 AM
??? ?????? ?? ????????

troseberry
27 Sep 2010, 11:56 AM
check out Jay's screencast on abstract classes. Hope this helps http://tdg-i.com/364/abstract-classes-with-ext-js

pav-pas
27 Sep 2010, 12:02 PM
????? ??????? ?? ???, ?????? ?????????? ??? ?? ?????? ????????? ????????? ?????????, ??? ????? ? ????? ??????????? ?? ????? ? ??????? ??????????, ?????? ??? ?? ???????? ??? ???...????? ?? ????????...? ? ??????? ??? ??????????? ???????????? ?????????? ?????? ????? ????? ?????? ? ????? ?????....