浏览 3924 次
该帖已经被评为新手帖
|
|
---|---|
作者 | 正文 |
发表时间:2008-03-29
Ext.onReady(function() { var northPanel = new Ext.Panel({ region: 'north', autoLoad: {url: 'top.jsp'}, split: false, height: 31, minSize: 31, maxSize: 31 }); var treePanel = new Ext.Panel({ title: 'Menus', region: 'west', contentEl: 'layout_menu', split: true, border: true, collapsible: false, margins:'2 0 5 0', cmargins:'0 0 0 0', lines:false, autoScroll:true, autoHeight:false, width: 220, minSize: 220, maxSize: 220 }); mainPanel = new Ext.TabPanel({ region:'center', resizeTabs:true, minTabWidth: 135, tabWidth: 135, margins:'2 0 5 0', cmargins:'0 0 0 0', activeTab: 0, items: { id:'welcome-panel', title: 'Index', autoLoad: {url: 'welcome.html',scripts:true} } }); //mainPanel.activate('welcome-panel'); var viewport = new Ext.Viewport({ layout:'border', items:[northPanel, treePanel, mainPanel] }); var menudata = { "id":"rootmenu", "text":"System Maintaince", "singleClickExpand":true, "iconCls":"icon-pkg", "isClass":true, "children":[{ "href":"maintaince/menus/list.jsp", "text":"Menus", "id":"test1", "edit":false, "leaf":true, "iconCls":"icon-cls" },{ "href":"maintaince/menubuttons/list.jsp", "text":"MenuButtons", "id":"test2", "edit":false, "leaf":true, "iconCls":"icon-cls" },{ "href":"maintaince/functioncode/list.jsp", "text":"FunctionUNITS", "id":"test3", "edit":false, "leaf":true, "iconCls":"icon-cls" },{ "href":"maintaince/functionurl/list.jsp", "text":"FunctionURL", "id":"test4", "edit":false, "leaf":true, "iconCls":"icon-cls" },{ "href":"maintaince/functioncolumn/list.jsp", "text":"FunctionDLL", "id":"test5", "edit":false, "leaf":true, "iconCls":"icon-cls" },{ "href":"maintaince/functionlist/list.jsp", "text":"FunctionLIST", "id":"test6", "edit":false, "leaf":true, "iconCls":"icon-cls" },{ "href":"maintaince/functionprint/list.jsp", "text":"FunctionPRINT", "id":"test7", "edit":false, "leaf":true, "iconCls":"icon-cls" },{ "href":"maintaince/functionquery/list.jsp", "text":"FunctionQUERY", "id":"test8", "edit":false, "leaf":true, "iconCls":"icon-cls" } ] }; var menudata2 = { "id":"rootmenu2", "text":"Database Maintaince", "singleClickExpand":true, "iconCls":"icon-pkg", "isClass":true, "children":[{ "href":"maintaince/menus/list.jsp", "text":"Menus", "id":"test21", "edit":false, "leaf":true, "iconCls":"icon-cls" },{ "href":"maintaince/menubuttons/list.jsp", "text":"MenuButtons", "id":"test22", "edit":false, "leaf":true, "iconCls":"icon-cls" },{ "href":"maintaince/functioncode/list.jsp", "text":"FunctionUNITS", "id":"test23", "edit":false, "leaf":true, "iconCls":"icon-cls" },{ "href":"maintaince/functionlist/list.jsp", "text":"FunctionLIST", "id":"test24", "edit":false, "leaf":true, "iconCls":"icon-cls" },{ "href":"maintaince/menubuttons/list.jsp", "text":"MenuButtons", "id":"test25", "edit":false, "leaf":true, "iconCls":"icon-cls" },{ "href":"maintaince/functioncode/list.jsp", "text":"FunctionUNITS", "id":"test263", "edit":false, "leaf":true, "iconCls":"icon-cls" },{ "href":"maintaince/functionlist/list.jsp", "text":"FunctionLIST", "id":"test27", "edit":false, "leaf":true, "iconCls":"icon-cls" } ] }; var Tree = Ext.tree; var treePanel = new Tree.TreePanel({ el:'layout_menu', border : false, rootVisible:true, animate:true, enableDD:false, lines:false, containerScroll: true, loader: new Ext.tree.TreeLoader({ preloadChildren: true, clearOnLoad: true }), root: new Ext.tree.AsyncTreeNode({ text:'CareSoft', id:'root', iconCls:"icon-pkg", expanded:true, children:[menudata,menudata2] }), collapseFirst:false }); treePanel.render(); treePanel.expandAll(); new Tree.TreeSorter(treePanel,{folderSort:true}); treePanel.on("click", function(node, e){ e.stopEvent(); var _attr = node.attributes; var _href = _attr.href; if(node.isLeaf() && _href){ var _id = node.id; var _tab = mainPanel.findById(_id); if(_tab) { mainPanel.activate(_id); return; } mainPanel.add({ id: _id, title: node.text, autoHeight: true, margins:'5 5 5 5', autoLoad: {url: _href, scripts:true, params: 'id='+ _id +'&title=' + node.text }, closable:true }).show(); } }); }); 在IE中运行正常,但在 FireFox中菜单那部份是空白的,用FireBug可以看到有元素存在,但就是没有显示出来,错误信息没有,只有一些CSS方面的警告,请各位指教。 另外,个人感觉到看sample挺漂亮的,但自己做到应用程序中后,发现并不怎么样,感觉不是很清爽,还不如1.1中那个纯蓝色的感觉好,你们认为呢? 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2008-04-07
我也碰到了这个问题,
我用firebug是可以一层一层的点到显示不了的树的跟节点的 搞不懂怎么回事为什么没显示出来 |
|
返回顶楼 | |
发表时间:2008-04-08
试出来了
要给panel的容器定义相应的样式才可以显示,指定宽度高度就可以显示了 |
|
返回顶楼 | |