ero
4 Sep 2011, 12:27 AM
Hello,
I noted in the documentation for Ext.tree.Column that: "NOTE This is a private utility class for internal use by the framework. Don't rely on its existence."
However, I have an app that uses treepanel to display various data sets depending on the user selection. While each data set is different, each report has some common columns. For that reason I have chosen to define some columns so that I can re-use the code.
So for example, I am defining a column something like this:
Ext.define('app.view.columns.Sample', {
extend: 'Ext.grid.column.Column'
,alias: 'widget.sampleColumn'
,initComponent: function( ) {
Ext.apply(this, {
text: "Sample"
,dataIndex: "sampleCol"
,sortable: false
,align: "right"
,width: 50
});
this.callParent(arguments);
}
});
This works fine and I'm able to do the same for a treecolumn as follows:
Ext.define('app.view.columns.TreeSample', {
extend: 'Ext.tree.Column'
,alias: 'widget.treeSampleColumn'
,initComponent: function( ) {
Ext.apply(this, {
text: "Tree Sample"
,dataIndex: "treeSampleCol"
,sortable: false
,align: "right"
,width: 50
});
this.callParent(arguments);
}
});
So I have two questions:
1. If we should not use Ext.tree.Column, then what should we use? I tried Ext.grid.column.Column, but that did not seem to work - I may be missing something though.
2. If I stick with extending Ext.tree.Column, then what might the risks be?
Thank you,
I noted in the documentation for Ext.tree.Column that: "NOTE This is a private utility class for internal use by the framework. Don't rely on its existence."
However, I have an app that uses treepanel to display various data sets depending on the user selection. While each data set is different, each report has some common columns. For that reason I have chosen to define some columns so that I can re-use the code.
So for example, I am defining a column something like this:
Ext.define('app.view.columns.Sample', {
extend: 'Ext.grid.column.Column'
,alias: 'widget.sampleColumn'
,initComponent: function( ) {
Ext.apply(this, {
text: "Sample"
,dataIndex: "sampleCol"
,sortable: false
,align: "right"
,width: 50
});
this.callParent(arguments);
}
});
This works fine and I'm able to do the same for a treecolumn as follows:
Ext.define('app.view.columns.TreeSample', {
extend: 'Ext.tree.Column'
,alias: 'widget.treeSampleColumn'
,initComponent: function( ) {
Ext.apply(this, {
text: "Tree Sample"
,dataIndex: "treeSampleCol"
,sortable: false
,align: "right"
,width: 50
});
this.callParent(arguments);
}
});
So I have two questions:
1. If we should not use Ext.tree.Column, then what should we use? I tried Ext.grid.column.Column, but that did not seem to work - I may be missing something though.
2. If I stick with extending Ext.tree.Column, then what might the risks be?
Thank you,