急急急ext页面错误求解.
这是用ext编写的一个页面用ie打开是上边和下边都会出现一个白框用火狐打开就没事各位高手给看看上面毛病。图先上传不上来谢谢各位啦Ext.onReady(function() {
Ext.QuickTips.init(); //浮动信息提示
Ext.onReady(function(){ //ie补全
Ext.BLANK_IMAGE_URL = 'ExtJs/resources/images/default/s.gif';
});
var root = new Ext.tree.AsyncTreeNode({
id:"1", //设置跟节点
text:"用户权限",
//icon:'image/1.png',//设置图片
draggable:false,//根节点不容许拖动
expanded:true //展开节点
});
var loader = new Ext.tree.TreeLoader({url:"model!LoadTreeMenu.action"}); //获取url地址
loader.processResponse = function(response, node, callback){
var json = response.responseText;
try {
var json = eval("("+json+")");
node.beginUpdate();
var o = json["nodetree"]; //获取json数组
for(var i = 0, len = o.length; i < len; i++){
var n = this.createNode(o[i]);
if(n){
node.appendChild(n);
}
n.expanded=false;
}
node.endUpdate();
if(typeof callback == "function"){
callback(this, node);
}
}catch(e){
this.handleFailure(response);
}
};
var tree = new Ext.tree.TreePanel({
useArrows: true,
region: 'west',
border: false,
root: root,
frame:true,//美化界面
autoScroll:true,// 自动滚动
enableDD:true,//拖动效果
containerScroll : true,// 是否支持滚动条
rootVisible:true, //是否隐藏根节点
animate:true, //动画效果
collapsible:true,
split:true,
width: 160,
minSize: 140,
maxSize: 180,
loader:loader
});
var sorter = new Ext.tree.TreeSorter(tree, {
folderSort: true //菜单排序
});
//界面主题按钮
var MenuBtn = new Ext.Button({
text : '界面风格',
height:30,
//icon : 'image/1.png',
menu : [{
text : '默认',
group : 'name',
checked : checkcss(''), //检查css
handler : function() { //改变css
changecss(' ');
}
}, {
text : '灰色',
group : 'name',
checked : checkcss('xtheme-gray.css'),
handler : function() {
changecss('xtheme-gray.css');
}
}, {
text : '绿色',
group : 'name',
checked : checkcss('xtheme-green.css'),
handler : function() {
changecss('xtheme-green.css');
}
}, {
text : '紫色',
group : 'name',
checked : checkcss('xtheme-purple.css'),
handler : function() {
changecss('xtheme-purple.css');
}
}, {
text : '深灰色',
group : 'name',
checked : checkcss('xtheme-darkgray.css'),
handler : function() {
changecss('xtheme-darkgray.css');
}
}, {
text : '靛青色',
group : 'name',
checked : checkcss('xtheme-indigo.css'),
handler : function() {
changecss('xtheme-indigo.css');
}
}, {
text : '黄绿色',
group : 'name',
checked : checkcss('xtheme-olive.css'),
handler : function() {
changecss('xtheme-olive.css');
}
}, {
text : '粉红色',
group : 'name',
checked : checkcss('xtheme-pink.css'),
handler : function() {
changecss('xtheme-pink.css');
}
}, {
text : '银黑色',
group : 'name',
checked : checkcss('xtheme-slickness.css'),
handler : function() {
changecss('xtheme-slickness.css');
}
}, {
text : '深蓝色',
group : 'name',
checked : checkcss('xtheme-slate.css'),
handler : function() {
changecss('xtheme-slate.css');
}
}, {
text : '黑夜色',
group : 'name',
checked : checkcss('xtheme-midnight.css'),
handler : function() {
changecss('xtheme-midnight.css');
}
}]
});
function changecss(name) {
var date = new Date();
date.setTime(date.getTime() + 30 * 24 * 3066 * 1000);
document.getElementsByTagName('link')[1].href = 'ExtJs/resources/css/' + name;
document.cookie = 'css=' + name + '; expires=' + date.toGMTString();// 设置cookies
}
var cookiesArr = document.cookie.split(';');
var css;
for (var i = 0; i < cookiesArr.length; i++) {
var arr = cookiesArr[i].split('=');
if (arr[0] == 'css') {
css = arr[1];
break;
}
}
document.getElementsByTagName('link')[1].href = 'ExtJs/resources/css/' + css;// 读取并应用css
function checkcss(name) {
var flag = false;
var cookiesArr = document.cookie.split(';');
var css;
for (var i = 0; i < cookiesArr.length; i++) {
var arr = cookiesArr[i].split('=');
if (arr[0] == 'css') {
css = arr[1];
break;
}
}
if (css == name) {
flag = true;
}
return flag;
}
var viewport = new Ext.Viewport( {
layout : 'border',
items : [ {
region : 'north',
html : '上',
title : 'north',
height : 120
}, {
region : 'south',
tbar:[{xtype: 'tbfill'},{ xtype: 'tbseparator'} ,MenuBtn]//改变排列方式分隔符
}, {
region : 'west',
width : 160,
items:[tree] //将tree添加进来
},tree, {
region : 'center',
html : '中间',
title : 'center',
border : true,
split : true
} ]
});
});
--------------------编程问答-------------------- 国内的人最怕回答这种问题,因为要搭环境,要调试。 --------------------编程问答-------------------- 给介绍个工具 Ext Designer Preview EXT布局直接拖拽下控件代码 就自己生成好
补充:Java , Java EE