1 Attachment(s)
putting widgets inside InfoPanel
I want to add some widgets inside each InfoPanel in the accordion, in particular a treePanel.
I used var treePanel=new xt.TreePanel(parentInfoPanel.id, {...});
and also set layout on the parent InfoPanel and then add treePanel as a child. None of these approaches work as expected. In the first case the TreePanel fell outside of the InfoPanel, see attached image to see what I mean.
is this doable?
Code:
var leftnav = new Ext.ux.Accordion('leftnav', {
fitHeight: true,
boxWrap:true,
fitContainer: true
, fitToFrame: true
, useShadow: true
});
for ( var i = 0; i < oElement.nav.length; i++) {
if (oElement.nav[i].title) {
var el=leftnav.add(new Ext.ux.InfoPanel(oElement.nav[i]));
var sub_menu =new xt.TreePanel(el.id, {
animate:true,
enableDD:true,
containerScroll: true,
lines:false,
rootVisible:false,
loader: new Ext.tree.TreeLoader({
// dataUrl:'menu_gen.php'
})
});
var croot = new xt.AsyncTreeNode({
allowDrag:false,
allowDrop:true,
//id:'croot',
text:'Packages and Components',
cls:'croot',
loader:new Ext.tree.TreeLoader({
dataUrl:'menu_gen.php',
createNode: readNode
})
});
/*
var layout = new Ext.BorderLayout(el.id, {
north: {
split: false, initialSize: 10
},
south: {
split: false, initialSize: 10
},
east: {
split: false, initialSize: 10
},
west: {
split: false, initialSize: 10
},
center: { }
});
layout.add('CENTER',sub_menu);
*/
//el.setContent(sub_menu,true);
sub_menu.setRootNode(croot);
sub_menu.render();
croot.expand();
does this work with grids also
I assumed you can put a grid on an InfoPanel as well but I am not having much luck. I have created roughly the same structure as above, but for some reason the grid never renders. Any pointers?
HTML Code:
<div id="center-div" style="height:100%;width:100%">
<div id="pnlCenter" style="height:100%;width:100%;background-color:Aqua"></div>
</div>
Code:
var iconPath = 'images/icons/';
//set up Work Breakdown Accordion
var acc = new Ext.ux.Accordion('center-div', {
fitHeight: true,
fitToFrame: true,
fitContainer: true
})
//define a panel
var pnlCent = acc.add(new Ext.ux.InfoPanel('pnlCenter', {
icon:iconPath + 'folder.png'
, autoScroll: true
, maxHeight: 500
, fixedHeight: 460
}));
//set up dataStore for the grid
var dataStore = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url: 'PolicyTransactions.xml'}),
reader: new Ext.data.XmlReader({
record: 'WorkItem',
id: 'WITTSID'
},
['Type', 'Status', 'Priority', 'AssignedResource', 'TransactionCode']
)})
//set up the grid columns
var colModel = new Ext.grid.ColumnModel(
[
{header: "Status", width: 120, dataIndex: 'Status'},
{header: "Priority", width: 180, dataIndex: 'Priority'},
{header: "AssignedResource", width: 115, dataIndex: 'AssignedResource'},
{header: "TransactionCode", width: 100, dataIndex: 'TransactionCode'}
]);
//create the grid
var grid = new Ext.grid.Grid(pnlCent.body, {
ds: dataStore,
cm: colModel
});
dataStore.load();
grid.render();