Maybe it's dumb question, but I didin't find a way. You extend the ExtJS TreePanel in PersistentFilterPicker and hardcode different functionality which I would like to modify.
- Code: Select all
Tine.Invoices.TreePanel = Ext.extend(Tine.widgets.grid.PersistentFilterPicker, {
// quick hack to get filter saving grid working
//recordClass: Tine.Invoices.Model.Invoice,
initComponent: function() {
this.filterMountId = 'Invoice';
this.root = {
id: 'root',
leaf: false,
expanded: true,
loader: new Ext.tree.TreeLoader({
preloadChildren: true,
dataUrl:'index.php?method=Invoices.getTreeCompanies'
})...
From index.php?method=Invoices.getTreeCompanies I get:
[{"text":"test","id":"id","leaf":false,"cls":"folder"}]
However this creates an error:
Event thread: click
Error:
name: TypeError
message: Statement on line 84: Cannot convert undefined or null to Object
Backtrace:
Line 84 of linked script http://localhost/tine200/Tinebase/js/wi ... 1240745238
this.getNodeById(this.filterMountId).appendChild(this.filterNode);
... Line 70 of linked script http://localhost/tine200/Invoices/js/In ... 1240907397
Tine.Invoices.TreePanel.superclass.afterRender.call(this);
Line 12863 of linked script http://localhost/tine200/library/ExtJS/ext-all-debug.js
this.afterRender(this.container);
... Line 14511 of linked script http://localhost/tine200/library/ExtJS/ext-all-debug.js
Ext.Container.superclass.render.apply(this, arguments);
Line 14819 of linked script http://localhost/tine200/library/ExtJS/ext-all-debug.js
c.render(target, position);
Line 14811 of linked script http://localhost/tine200/library/ExtJS/ext-all-debug.js
this.renderItem(c, i, target);
... Line 14944 of linked script http://localhost/tine200/library/ExtJS/ext-all-debug.js
Ext.layout.CardLayout.superclass.renderAll.call(this, ct, target);
Line 14796 of linked script http://localhost/tine200/library/ExtJS/ext-all-debug.js
this.renderAll(ct, target);
... Line 14904 of linked script http://localhost/tine200/library/ExtJS/ext-all-debug.js
Ext.layout.FitLayout.superclass.onLayout.call(this, ct, target);
Line 14790 of linked script http://localhost/tine200/library/ExtJS/ext-all-debug.js
this.onLayout(this.container, target);
Line 14935 of linked script http://localhost/tine200/library/ExtJS/ext-all-debug.js
this.layout();
Line 287 of linked script http://localhost/tine200/Tinebase/js/Ma ... 1240745236
cardPanel.layout.setActiveItem(panel.id);
Line 113 of linked script http://localhost/tine200/Tinebase/js/wi ... 1240745238
Tine.Tinebase.MainScreen.setActiveTreePanel(this.treePanel, true);
Line 59 of linked script http://localhost/tine200/Tinebase/js/wi ... 1240745238
this.setTreePanel();
Line 72 of linked script http://localhost/tine200/Tinebase/js/Ap ... 1240745223
app.getMainScreen().show();
...
This is the way I used to populate a regular TreePanel, but it doesn't work with Tine.widgets.grid.PersistentFilterPicker. Please, tell me a way to populate the tree from a database records.
Thanks in advance


