日期:2014-05-16 浏览次数:20382 次
<Control id="tree2" type="Tree">
<Events>
<Event name="beforeExpandNode">
<![CDATA[
var brancode = "%{#session.CheckIn.BranCode}";
if(brancode=="00"){
brancode=null;
}
if (node.children().getLength()>0) return;
var BMP = "../../images/node.gif";
var dataset ="";
if(node.getTag()!=null){
dataset=BranDataset3;
dataset.parameters().clear();
dataset.parameters().setValue("areacode", node.getTag(),"string");
if(brancode!="00"){
dataset.parameters().setValue("brancode", brancode,"string");
}
dataset.flushData();
}else{
dataset=BranDataset2;
dataset.parameters().clear();
dataset.flushData();
}
if (node.getLevel() == 0 && brancode!="00")
{
var newNode = tree.addNode(node, "全部");
newNode.setHasChild(true);
newNode.setIcon("../../images/share.gif");
newNode.setExpandedIcon("../../images/share.gif");
newNode.setCheckable(true);
}
else
{
var ParentBranID = 0;
if(node.getTag() == null)
ParentBranID = 0;
else
ParentBranID = node.getTag();
var level = node.getLevel();
while (!dataset.isLast())
{
var label = dataset.getString("areaname");
var newNode = tree.addNode(node, label);
newNode.setCheckable(true);
newNode.setHasChild(dataset.getValue("SubCount") > 0);
newNode.CurBranID = dataset.getValue("areacode");
newNode.setTag(dataset.getString("areacode"));
newNode.setIcon(BMP);
newNode.setExpandedIcon(BMP);
//1全选,0非全选,-1全未选
if(dataset.getValue("Status") == 0){
newNode.setChecke