[img]http://dl.iteye.com/upload/attachment/240592/a298c018-c1e9-3eb6-9d83-8f17394fabbe.jpg[/img]
中间出现一片空白,不让其改变大小..不要中间的空白..希望能把左边的树边框大小固定的,有办法么?
// panel默认加载URL,记录当前panel所加载的URL
var url = "knowledge!showKnowLedgePage.do";
Ext.onReady(newViewPort);
// 新建子类对象
var subTypeWin;
var subTypeForm;
// 新建知识对象
var knowLedgeWin;
var knowLedgeForm;
// 当前选择的节点
var currentNode;
var treeLoad = new Ext.tree.TreeLoader({url:"knowledge!getTreeNode.do"});
function newViewPort() {
new Ext.Viewport({
enableTabScroll : true,
layout : "border",
items : [tree, panelCenter]
});
}
var tree = new Ext.tree.TreePanel({
id : "westTreePanel",
width : 200,
align : 'left',
autoScroll : true,
animate : true,
enableDD : false,
containerScroll : true,
rootVisible : true,
lines : true,
frame : true,
// collapsible : true,
singleClickExpand : false,// 支持单击展开
region : 'west',
margins : '0 0 5 5',
cmargins : '0 5 5 5',
split : true,
border : true,
maxWidth : 200,
minWidth : 20,
root : {
text : '知识管理',
id : '0',
nodeType : 'async',
expanded : true
},
listeners : {
'click' : function(node, e) {
currentNode = node;
if(node.id==this.getRootNode().id){
open(url,'rightContentFrame','');
//panelLoad(panelCenter, url);
}
node.expand();
},
'dblclick' : function(node, e) {
//node.expand();
}
},
loader : treeLoad
});
var panelCenter = new Ext.Panel({
id : "panelCenter",
region : 'center',
autoScroll : true
});
function panelLoad(panel, url) {
if (panel != undefined) {
panel.load({
url : url,
text : "正在加载,请稍候……",
nocache : true,
scripts : true
});
}
}
function reloadCurrentNode(){
if(currentNode!=undefined){
currentNode.reload();
}
}
function reloadParentNode(){
if(currentNode!=undefined){
currentNode.parentNode.reload();
}
}
/**
- 新建子类窗口 */ function openSubTypeWin() { if (subTypeWin == undefined) { subTypeWin = new Ext.Window({ height : 300, width : 500, title : '知识库管理', closeAction : 'close', modal : true, items : [getSubTypeForm()], listeners : { "beforedestroy" : function(obj) { obj.hide(); return false; } } }); } else { subTypeWin.hide(); } subTypeWin.show(); };
/**
- 获取创建子类别Form
- @return */ function getSubTypeForm() { if (subTypeForm == undefined) { subTypeForm = new Ext.FormPanel({ id : 'subTypeForm', height : 300, frame : true, items : [{ columnWidth : .2, buttonAlign : 'center', defaultType : 'textfield', layout : 'form', items : [{ fieldLabel : '类别名称', name : 'name', anchor : '95%', allowBlank : false, emptyText : '请填写类别名称' }, { fieldLabel : '类别描述', xtype : 'textarea', name : 'desc', anchor : '95%', allowBlank : true }], buttons : [{ text : "提交", handler : function() { if (subTypeForm.getForm().isValid()) { subTypeForm.getForm().submit({ url : "knowledge!createChildNode.do", params : { id : nodeId }, success : function(response, options) { subTypeForm.getForm().reset(); // 重新加载数据 subTypeWin.hide(); currentNode.reload(); } }); } } }, { text : "重置", handler : function() { subTypeForm.getForm().reset(); } }] }] }); } return subTypeForm; }
/**
- 新建知识窗口 */ function openKnowLedgeWin() { if (knowLedgeWin == undefined) { knowLedgeWin = new Ext.Window({ height : 300, width : 350, title : '编辑', closeAction : 'close', modal : true, items : [getKnowLedgeForm()], listeners : { "beforedestroy" : function(obj) { obj.hide(); return false; } } }); } else { knowLedgeWin.hide(); } knowLedgeWin.show(); };
/**
- 新建知识Form
- @return */ function getKnowLedgeForm() { if (knowLedgeForm == undefined) { knowLedgeForm = new Ext.FormPanel({ id : 'knowLedgeForm', height : 300, frame : true, items : [{ columnWidth : .2, defaultType : 'textfield', layout : 'form', items : [{ fieldLabel : '所属类别', name : 'parentName1', anchor : '95%' }, { fieldLabel : '标题', name : 'title', anchor : '95%', allowBlank : false, emptyText : '请填写知识标识' }, { fieldLabel : '关键字', name : 'keywords', anchor : '95%', allowBlank : true }, { fieldLabel : '描述', name : 'desc', anchor : '95%', allowBlank : true }, { fieldLabel : '内容', name : 'content', anchor : '95%', allowBlank : true }], buttons : [{ text : "提交", handler : function() { if (knowLedgeForm.getForm().isValid()) { knowLedgeForm.getForm().submit({ url : "knowledge!createChildNode.do", params : { nodeId : nodeId }, success : function(response, options) { // 重新加载数据 } }); } } }, { text : "重置", handler : function() { knowLedgeForm.getForm().reset(); } }] }] }); } return knowLedgeForm; }