defalutValue函数通过对combotree的tree对象追加一个用户想要的默认值节点,并使其隐藏来达到设置默认值的效果:
$("#moduls_funbase_sysmgr_addUnit_combotree").combotree({
url : '${pageContext.request.contextPath}/base_sysmgr_demoController/getUnitParamTree.do?superunitid1=',
valueField:'id',
textField:'text',
parentField:'pid',
panelWidth:'200',
onClick : function(node) {
//console.log(node);
},
onBeforeExpand:function(node,param){
$(this).tree('options').url =
'${pageContext.request.contextPath}/base_sysmgr_demoController/getUnitParamTree.do?superunitid1='+node.id;
},
onLoadSuccess:function(node,data){
defaultValue('moduls_funbase_sysmgr_addUnit_combotree','100','默认值文本');//这个方法就是解决默认值的问题核心
}
});