rpsirois
6 Aug 2012, 10:46 AM
How can I accomplish nested form data with TreePanels? I feel as if this question has been asked a lot, but I can't seem to find a good solution.
The cheater sort of way I was attempting looks like this:
(tree panel)
beforeitemexpand: function( record, opts ) {
this.getStore().getProxy().extraParams.cmd = 'list_attributes';
this.getStore().getProxy().extraParams.categoryID = record.data.typeID;
this.getStore().getProxy().setModel( 'BIS.model.AttributeModel' );
},
I agree that that is a little ridiculous. The problem is when I want a different node (say, the parent node with a different model), I get undefined data.
I would think that using Model's #hasMany: / #belongsTo: properties would provide some functionality to this end?
The data does need to be loaded dynamically. Pre-loading the entire graph is not an option.
Thanks
The cheater sort of way I was attempting looks like this:
(tree panel)
beforeitemexpand: function( record, opts ) {
this.getStore().getProxy().extraParams.cmd = 'list_attributes';
this.getStore().getProxy().extraParams.categoryID = record.data.typeID;
this.getStore().getProxy().setModel( 'BIS.model.AttributeModel' );
},
I agree that that is a little ridiculous. The problem is when I want a different node (say, the parent node with a different model), I get undefined data.
I would think that using Model's #hasMany: / #belongsTo: properties would provide some functionality to this end?
The data does need to be loaded dynamically. Pre-loading the entire graph is not an option.
Thanks