EXT后台数据传输
WEBWORK里的Action里有很多方法,将数据放入JSON里但值是返回值都设为的none,前端的EXT tree怎么取得的后台的字符串的。 --------------------编程问答-------------------- 用的是变量吧?放在session里吧 --------------------编程问答-------------------- function parseStr(cString){
if(!treeExists){
tree = new Ext.tree.TreePanel({
el : 'tree-div',
autoScroll : true,
animate : true,
line : true,
height : 295,
selMode : true,
rootVisible : true,//根节点隐藏
baseCls : 'background:transparent;',
loader : false
});
var rootNode = new Ext.tree.TreeNode( {
text : '宁波智慧易做图',
icon : './images/group.gif',
draggable : false,
id : '0'
});
tree.setRootNode(rootNode);
tree.render();
rootNode.expand();
tree.on("click", function(node) {
if (node != null) {
if (node.isLeaf()) {
var FullID = node.attributes.id;
sCameraID = FullID.substring(0,18);
sChannelID = FullID.substring(18,20);
if (sChannelID.substring(0,1) == 0) {
sChannelID = sChannelID.substring(1,2);
}
}
}
});
tree.on("dblclick", function(node) {
if (node != null) {
if (node.isLeaf()) {
StartVideo();//开始视频
} else {
if (node.attributes.cls != "folder")
{
tempNode = node;
WebOcx.GetChannelList(node.attributes.id);
node.expand(true);
} else {
node.collapseChildNodes();
}
}
}
});
treeExists = true;
}
var pulistArray = cString.split("$");
for (var i = 1;i < pulistArray.length; i++)
{
var puArray = pulistArray[i].split("|");
var puid = puArray[0];
var puname = puArray[1];
var status = puArray[3];
var childNode;
if (status == 0) {
childNode = new Ext.tree.TreeNode( {
id : puid,
text : puname,
icon : './images/pu-items.gif',
//cls : 'x-tree-node-disabled',
disabled: false,
type: status,
leaf : false
});
} else {
childNode = new Ext.tree.TreeNode( {
id : puid,
text : puname,
icon : './images/pu-items.gif',
disabled: false,
type: status,
leaf : false
});
}
tree.getRootNode().appendChild(childNode);
}
}
这里的cString这组字符串是通过ExtAction传过来的,但是Action里有很多方法,而且都是RETURN NONE。采用的webwork框架。及时找不到cString从哪儿来的。
补充:Java , Web 开发