| | |
| | | NMTREEVIEW& nmtv = *(NMTREEVIEW*)evt->notify.pnmh; |
| | | HTREEITEM sitem = nmtv.itemNew.hItem; |
| | | |
| | | return 1; |
| | | |
| | | xstring id = tv_org.GetItemData(sitem); |
| | | HCURSOR hCursor = xutil::SetCursorWait(); |
| | | OnCreateTree(id, sitem); |
| | |
| | | //sRootOrgName = ele1.selectSingleNode(L"CompanyID/@_displaystring").text(); |
| | | } |
| | | |
| | | xstring ls_orgid = ele.selectSingleNode(L"@guid").text(); |
| | | sOrgID = ls_orgid + L""; |
| | | //trace(sOrgID); |
| | | sOrgName = ele.selectSingleNode(L"OrgName").text(); |
| | | string str = ele.xml(); |
| | | if(ele.selectSingleNode(L"@guid")) |
| | | sOrgID = ele.selectSingleNode(L"@guid").text(); |
| | | if(ele.selectSingleNode(L"OrgName")) |
| | | sOrgName = ele.selectSingleNode(L"OrgName").text(); |
| | | OnRetrieve(); |
| | | return 1; |
| | | } |
| | |
| | | str += L"<treeitem src='xquery:[OrgChart.hr.xq]' src1='xquery:[OrgStructureRetrieve.xq]' xcaption='OrgName' xroot='/root' xpath='Org' xchildpath='Org' image='15' loop='yes' xdata='.'/>"; |
| | | str += L"</xtree></vbox>"; |
| | | xstring xfNodeAgentArea = L"tree"; |
| | | xnode anode = new xnode; |
| | | anode.setNativePointer(GetAgentNode(xfNodeAgentArea)); |
| | | xnode anode = GetAgentNode(xfNodeAgentArea); |
| | | SetAgentNode(anode, str); |
| | | tv_org = GetControl(L"tv_org"); |
| | | AttachEvent(L"tv_org", L"TVN_SELCHANGED", (FEvent)&HrOrg::OnTreeSelecded); |
| | |
| | | AttachEvent(L"WM_SETFOCUS", (FEvent)&HrOrg::OnSetFocus); |
| | | //获得树的点击事件 |
| | | AttachEvent(L"tv_org", L"TVN_SELCHANGED", (FEvent)&HrOrg::OnTreeSelecded); |
| | | AttachEvent(L"tv_org", L"TVN_ITEMEXPANDING", (FEvent)&HrOrg::OnTreeExpanding); |
| | | //AttachEvent(L"tv_org", L"TVN_ITEMEXPANDING", (FEvent)&HrOrg::OnTreeExpanding); |
| | | AttachEvent(L"tv_org", L"TVN_ENDDRAG", (FEvent)&HrOrg::OnTreeMoveNode); |
| | | //双击 |
| | | AttachEvent(L"dw_list", L"DWV_DOUBLECLICKED", (FEvent)&HrOrg::OnDoubleClicked); |
| | |
| | | int onload() |
| | | { |
| | | tv_org = GetControl(L"tv_org"); |
| | | dw_list = new xdwgrid; |
| | | dw_list.setNativePointer(GetControl(L"dw_list")); |
| | | dw_list = GetControl(L"dw_list"); |
| | | dw_list.openUrl(L"组织架构.vface/template/HrOrg/list"); |
| | | dw_list.SetSelectionMode(1); |
| | | dw_list.SetReadOnly(true); |
| | |
| | | |
| | | //OnCreateTree(L"00000000-0000-0000-0000-000000000000", 0); |
| | | HTREEITEM root = tv_org.GetRootItem(); |
| | | if (!root) |
| | | if (root) |
| | | { |
| | | tv_org.ExpandItemEx(root); |
| | | KXMLDOMElement ele = tv_org.GetItemData(root); |
| | | if (ele) |
| | | { |
| | | xstring ls_orgid = ele.selectSingleNode(L"@guid").text(); |
| | | sOrgID = ls_orgid + L""; |
| | | sOrgName = ele.selectSingleNode(L"OrgName").text(); |
| | | if(ele.selectSingleNode(L"@guid")) |
| | | sOrgID = ele.selectSingleNode(L"@guid").text(); |
| | | if(ele.selectSingleNode(L"OrgName")) |
| | | sOrgName = ele.selectSingleNode(L"OrgName").text(); |
| | | OnRetrieve(); |
| | | } |
| | | } |