hi,
i'm just learning how to extend Ext classes.
i am having trouble with the one included below. in onStoreLoad() the comboboxes are added to the panel as expected. but the problem is that they disregard the tablelayout of the panel they are added to. is there some other way to do this?
thanks.
LT
Application.ClientCheckBoxGroup = Ext.extend(Ext.Panel, { Macopinion:: And I added RAM to 768 MB. with a 160GB drive in my MacBook, the Air would be a step back Id have trouble For the high-class market it was going for, http://www.macopinion.com/index.php/site/more/ heaven_caoore@applelinks.com/P120/HOME | irclogs.ubuntu.com/2008/02/19/#kubuntu.txt:: [ 00:25] <unagi_> sub[t]rnl: i didnt have zaxismapping so i added it with 6 and 7, anyone had trouble ripping Led Zeppelins you mean the whole panel? http://irclogs.ubuntu.com/2008/02/19/#kubuntu.txtHOME |
initComponent:function() {
Application.ClientCheckBoxGroup.superclass.initCom ponent.apply(this, arguments);
this.store = new Application.PartyStore({baseParams: {roleName: this.roleName}});
this.store.on({
load: { fn: this.onStoreLoad, scope: this },
loadexception: { fn: this.onStoreLoadException, scope: this }
});
},
onRender:function(ct, position) {
Application.ClientCheckBoxGroup.superclass.onRende r.call(this, ct, position);
this.add({
xtype: 'panel'
,id: this.cbPanelId
,layout: 'table'
,layoutConfig: { columns: this.columns }
//,items: Advogato - Recent Blog Entries:: deposit to start using it, rendering this issue moot in the future? I set out this term to teach a CS class in the way I would have wanted it taught http://advogato.org/recentlog.html?thresh=4HOME |
});
},
load: function (p) {
var _p = p {};
this.store.load({
params: _p
});
},
onStoreLoad: function (store, records, params) {
var cbPanel = this.getComponent(this.cbPanelId);
for (var i = 0; i < records.length; i++) {
var id = 'cb-' + records[i].id + '-' + Ext.id();
var cb = new Ext.form.Checkbox({
id: id,
inputValue: records[i].id,
name: this.cbGroupName,
boxLabel: records[i].name,
checked: false,
width: 115,
renderTo: cbPanel.el.child('.x-table-layout')
})
cbPanel.add(cb);
}
this.doLayout();
},
onStoreLoadException: function (httpProxy, dataObj, callbackArg) {
showErrors(getResponseFailureErrors(callbackArg));
},
check: function (ids) {
},
roleName: '',
columns: 3,
cbGroupName: 'cb-group',
store: null,
cbPanelId: 'cb-panel-' + Ext.id()
});
Ext.reg('clientcheckboxgroup', Application.ClientCheckBoxGroup);
ccbg = new Application.ClientCheckBoxGroup({
renderTo: 'container'
,roleName: 'client'
,cbGroupName: 'clients'
});
ccbg.load();
Better would be to add panel with table layout to parent panel items (via xtype). Then you do not need to even think when it is rendered as Ext would take care.
The whole point of this "pre-configured" classes technology is to leave as much job and decisions to Ext as possible. If you need to think: "Should I render my components from onRender or from afterRender?" then there is something wrong with the basic concept.
Very good example of what I'm talking about is: http://examples.extjs.eu/?ex=compcomm
Take a look at the source code.
Cool! Thanks, Saki!
LT
Traditional University or MLM University? You Choose
15 Questions to Ask Your Software Vendor
|