利用ComboZtree完成机构岗位二级联动

$('#positions').comboztree({

async:'false',

idfield:'positionId',

pidfield:'parentPositionId',

textfield:'positionName',

valuefield:'positionId',

rootpidvalue:'0',

panelHeight:'auto',

required:true,

editable:true,//不可编辑,只能选择

value:'--请选择--'

});//初始化岗位树结构,不给数据

$('#orgs').comboztree({

url:'platform/appframe/afaorg/getAfaOrgList.do',

idfield:'orgId',

pidfield:'parentOrgId',

textfield:'orgName',

valuefield:'orgId',

rootpidvalue:'0',

onChange:function(org){//当机构树的选中内容发生改变的时候,清空当前岗位树的内容,重新加载数据

$('#positions').comboztree("clearValue");

$('#positions').comboztree("reload",'platform/appframe/position/afaorgposition/getAfaOrgPositionListByOrg.do?orgId='+org);

}

});

你可能感兴趣的:(利用ComboZtree完成机构岗位二级联动)