Zerogiven
17 Apr 2010, 3:36 PM
Hi all :)
I tried to play a bit with the designer and i really like it. it's cool to make just the user interface with simple clicks :D
i already understood how the ref and autoref works that i can call them with this as reference.
for example i already did this:
MyFormPanel = Ext.extend(MyFormPanelUi, {
initComponent: function() {
MyFormPanel.superclass.initComponent.call(this);
this.mySubmit.on("click", this.onSubmitForm);
}
// ... and so on
});
that was easy... ;)
i've two files MyFormPanel.js and MyFormPanel.ui.js...
so now for example i made a bigger application with the Designer like
a Viewport
- with 1 Formpanel (north)
- with 1 Treepanel (west)
- with 1 Panel (center)
All of them have events and other components.
I also got from the designer 2 files, what is ok at the moment cause i did no logic code just the ui. But how does i have to "split" my files (components). I can't make for example 20 events just in the main MyFormPanel.js file.
without the designer i did it normally like this:
Ext.ns('MyViewPort');
MyViewPort = Ext.extend(Ext.Viewport, {
/* DOING VIEWPORT CONFIGS */
initComponent: function() {
/* SETTING THE ITEMS ... for example item: [ xtype: 'myformpanel' ] */
MyViewPort.superclass.initComponent.call(this);
}
});
MyViewPort.formPanel = Ext.extend(Ext.form.FormPanel, {
/* DOING FORMPANEL CONFIGS */
initComponent: function() {
MyViewPort.formPanel.superclass.initComponent.call(this);
}
});
Ext.reg('myformpanel', MyViewPort.formPanel);
I don't get it how i can make it without mixing ui with logic code...
greetz
Chris
P.S.: Thanks to jacob.andresen for the ExtBeer example... it helped me a lot understanding the ref/autoref function at first
I tried to play a bit with the designer and i really like it. it's cool to make just the user interface with simple clicks :D
i already understood how the ref and autoref works that i can call them with this as reference.
for example i already did this:
MyFormPanel = Ext.extend(MyFormPanelUi, {
initComponent: function() {
MyFormPanel.superclass.initComponent.call(this);
this.mySubmit.on("click", this.onSubmitForm);
}
// ... and so on
});
that was easy... ;)
i've two files MyFormPanel.js and MyFormPanel.ui.js...
so now for example i made a bigger application with the Designer like
a Viewport
- with 1 Formpanel (north)
- with 1 Treepanel (west)
- with 1 Panel (center)
All of them have events and other components.
I also got from the designer 2 files, what is ok at the moment cause i did no logic code just the ui. But how does i have to "split" my files (components). I can't make for example 20 events just in the main MyFormPanel.js file.
without the designer i did it normally like this:
Ext.ns('MyViewPort');
MyViewPort = Ext.extend(Ext.Viewport, {
/* DOING VIEWPORT CONFIGS */
initComponent: function() {
/* SETTING THE ITEMS ... for example item: [ xtype: 'myformpanel' ] */
MyViewPort.superclass.initComponent.call(this);
}
});
MyViewPort.formPanel = Ext.extend(Ext.form.FormPanel, {
/* DOING FORMPANEL CONFIGS */
initComponent: function() {
MyViewPort.formPanel.superclass.initComponent.call(this);
}
});
Ext.reg('myformpanel', MyViewPort.formPanel);
I don't get it how i can make it without mixing ui with logic code...
greetz
Chris
P.S.: Thanks to jacob.andresen for the ExtBeer example... it helped me a lot understanding the ref/autoref function at first