Ext.tree.TreePanel 在IE下不正常加载
Ext.tree.TreePanel 在IE下不正常加载,两种解决方法 1不停的加载,直到true 2 使用Ext.Ajax.request
代码
|<script language ="javascript" type="text/javascript">
// var appmenu = new AppMenuView();
// appmenu.render('context');
var _url = 'http://localhost:14145/Menu/GetMenuFatherTree';
// _url="menu.ashx?model=0";
var tree = new Ext.tree.TreePanel({
id: 'selectTree',
plugins: new NodeMouseoverPlugin(),
height: 200,
autoScroll: true,
split: true,
loader: new Ext.tree.TreeLoader({ url: _url
, listeners: {
"loadexception": function(loader, node, response) {
node.loaded = false;
node.reload.defer(10, node); //不停的加载,直到true
}
}
}),
root:
new Ext.tree.AsyncTreeNode({
expanded: true
}),
rootVisible: false,
requestMethod: "GET"
});
tree.on('mouseover', function(node, e) {
if (!node.isLeaf()) {
e.stopEvent();
tree.collapseAll();
node.expand();
}
});
tree.render('context');
</script>
|<script language ="javascript" type="text/javascript">
Ext.BLANK_IMAGE_URL = '../js/ext/images/default/s.gif';
var forumTree = new Ext.tree.TreePanel({
useArrows: true,
enableDD: true,
width: 200,
height: 300,
rootVisible: false,
root: new Ext.tree.AsyncTreeNode({})
});
forumTree.render('Div1');
// 由于使用TreeLoader在IE下无法正常加载数据,所以使用Ajax先获取数据再填充数据到root node下
Ext.Ajax.request({
url: 'Menu/GetMenuFatherTree',
success: function(request) {
var data = Ext.util.JSON.decode(request.responseText);
forumTree.getRootNode().appendChild(data);
forumTree.getRootNode().expandChildNodes(true);
},
failure: function() {
Ext.MessageBox.show({
title: '版块管理',
msg: '对不起,加载数据出现异常,请重试!',
buttons: Ext.MessageBox.OK,
icon: Ext.MessageBox.ERROR
});
}
});
-->
</script>
// var appmenu = new AppMenuView();
// appmenu.render('context');
var _url = 'http://localhost:14145/Menu/GetMenuFatherTree';
// _url="menu.ashx?model=0";
var tree = new Ext.tree.TreePanel({
id: 'selectTree',
plugins: new NodeMouseoverPlugin(),
height: 200,
autoScroll: true,
split: true,
loader: new Ext.tree.TreeLoader({ url: _url
, listeners: {
"loadexception": function(loader, node, response) {
node.loaded = false;
node.reload.defer(10, node); //不停的加载,直到true
}
}
}),
root:
new Ext.tree.AsyncTreeNode({
expanded: true
}),
rootVisible: false,
requestMethod: "GET"
});
tree.on('mouseover', function(node, e) {
if (!node.isLeaf()) {
e.stopEvent();
tree.collapseAll();
node.expand();
}
});
tree.render('context');
</script>
|<script language ="javascript" type="text/javascript">
Ext.BLANK_IMAGE_URL = '../js/ext/images/default/s.gif';
var forumTree = new Ext.tree.TreePanel({
useArrows: true,
enableDD: true,
width: 200,
height: 300,
rootVisible: false,
root: new Ext.tree.AsyncTreeNode({})
});
forumTree.render('Div1');
// 由于使用TreeLoader在IE下无法正常加载数据,所以使用Ajax先获取数据再填充数据到root node下
Ext.Ajax.request({
url: 'Menu/GetMenuFatherTree',
success: function(request) {
var data = Ext.util.JSON.decode(request.responseText);
forumTree.getRootNode().appendChild(data);
forumTree.getRootNode().expandChildNodes(true);
},
failure: function() {
Ext.MessageBox.show({
title: '版块管理',
msg: '对不起,加载数据出现异常,请重试!',
buttons: Ext.MessageBox.OK,
icon: Ext.MessageBox.ERROR
});
}
});
-->
</script>