刚开始学习extjs.现在碰到这样一个问题。我从a.aspx 异步获取到一些字符串,就是不断的循环红色的字那里。赋值给了js中的一个变量。现在我想把这个变量的内容替换掉红色字的那些。直接把变量放上去不行.<%=变量%> 这样也不行。谁知道怎么搞啊?
{
region: 'west',
id: 'west-panel', // see Ext.getCmp() below
title: '系统菜单',
split: true,
width: 200,
minSize: 175,
maxSize: 400,
contentEl: 'west',
collapsible: true,
margins: '0 0 0 5',
layout: {
type: 'accordion',
animate: true
},
items: [{ title: 'Navigation',
border: false,
xtype: 'treepanel',
autoScroll: true,
split: true,
loader: new Ext.tree.TreeLoader(),
root: new Ext.tree.AsyncTreeNode({
expanded: true,
children: [{
text: 'Menu Option 1',
leaf: true,
urlstr: 'http://www.baidu.com'
}, {
text: 'Menu Option 2',
leaf: true
}, {
text: 'Menu Option 3',
leaf: true
}]
}),
rootVisible: false,
listeners: {
click: function (n) {
Ext.MessageBox.alert('错误', menustr);
window.frames[0].location.href = n.attributes.urlstr;
}
}
}, { title: 'Navigation',
border: false,
xtype: 'treepanel',
autoScroll: true,
split: true,
loader: new Ext.tree.TreeLoader(),
root: new Ext.tree.AsyncTreeNode({
expanded: true,
children: [{
text: 'Menu Option 1',
leaf: true,
urlstr: 'http://www.baidu.com'
}, {
text: 'Menu Option 2',
leaf: true
}, {
text: 'Menu Option 3',
leaf: true
}]
}),
rootVisible: false,
listeners: {
click: function (n) {
window.frames[0].location.href = n.attributes.urlstr;
}
}
}]
{
region: 'west',
id: 'west-panel', // see Ext.getCmp() below
title: '系统菜单',
split: true,
width: 200,
minSize: 175,
maxSize: 400,
contentEl: 'west',
collapsible: true,
margins: '0 0 0 5',
layout: {
type: 'accordion',
animate: true
},
items: [{ title: 'Navigation',
border: false,
xtype: 'treepanel',
autoScroll: true,
split: true,
loader: new Ext.tree.TreeLoader(),
root: new Ext.tree.AsyncTreeNode({
expanded: true,
children: [{
text: 'Menu Option 1',
leaf: true,
urlstr: 'http://www.baidu.com'
}, {
text: 'Menu Option 2',
leaf: true
}, {
text: 'Menu Option 3',
leaf: true
}]
}),
rootVisible: false,
listeners: {
click: function (n) {
Ext.MessageBox.alert('错误', menustr);
window.frames[0].location.href = n.attributes.urlstr;
}
}
}, { title: 'Navigation',
border: false,
xtype: 'treepanel',
autoScroll: true,
split: true,
loader: new Ext.tree.TreeLoader(),
root: new Ext.tree.AsyncTreeNode({
expanded: true,
children: [{
text: 'Menu Option 1',
leaf: true,
urlstr: 'http://www.baidu.com'
}, {
text: 'Menu Option 2',
leaf: true
}, {
text: 'Menu Option 3',
leaf: true
}]
}),
rootVisible: false,
listeners: {
click: function (n) {
window.frames[0].location.href = n.attributes.urlstr;
}
}
}]
其实我还差一步。就是 js变量的值,如果可以当js脚本运行就好。。
text:l_item,这样?
asp.net 也有个开源的控件也值得一学,它集成了 ExtJs,叫 Coolite 非常不错,你可以参考下里面的代码