2016-12-15 2 views
0

Я использую эту библиотеку getorgchart для создания организационной диаграммы в своем приложении. Я просто хочу выделить конкретный узел, то есть пользователя, который зарегистрировался в приложении, его узел должен быть выделен.Как установить foucs на конкретном узле при использовании getorgchart

ответ

1
// Code goes here 

    var orgChart = new getOrgChart(document.getElementById("people"), { 
      theme: "monica", 
      primaryFields: ["name", "title"], 
      photoFields: ["image"], 
      gridView: true, 
      linkType: "B", 
      dataSource: [ 
       { id: 1, parentId: null, name: "Amber McKenzie", title: "CEO", phone: "678-772-470", mail: "[email protected]", adress: "Atlanta, GA 30303", image: "images/f-11.jpg" }, 
       { id: 2, parentId: 1, name: "Ava Field", title: "Paper goods machine setter", phone: "937-912-4971", mail: "[email protected]", image: "images/f-22.jpg" }, 
       { id: 3, parentId: 1, name: "Evie Johnson", title: "Employer relations representative", phone: "314-722-6164", mail: "[email protected]", image: "images/f-24.jpg" }, 
       { id: 6, parentId: 2, name: "Rebecca Randall", title: "Optometrist", phone: "801-920-9842", mail: "[email protected]", image: "images/f-8.jpg" }, 
       { id: 7, parentId: 2, name: "Spencer May", title: "System operator", phone: "Conservation scientist", mail: "[email protected]", image: "images/f-7.jpg" }, 
       { id: 8, parentId: 3, name: "Max Ford", title: "Budget manager", phone: "989-474-8325", mail: "[email protected]", image: "images/f-6.jpg" }, 
       { id: 9, parentId: 3, name: "Riley Bray", title: "Structural metal fabricator", phone: "479-359-2159", image: "images/f-3.jpg" } 
      ], 

      customize: { 
       "1": { color: "green" }, 
       "2": { theme: "deborah" }, 
       "3": { theme: "deborah", color: "darkred" } 
      } 
     }); 

Здесь

customize: { 
        "1": { color: "green" }, 
        "2": { theme: "deborah" }, 
        "3": { theme: "deborah", color: "darkred" } 
       } 

и может настроить для конкретного Id на основе ваших идентификаторов входа данных вы можете настроить и сделать его выделить

+0

это только затемнить узел, но я хочу, чтобы узел, чтобы выделить даже если он понижен на уровне и приближается к этому узлу. Спасибо :) –

+0

Я хочу, чтобы этот узел находился в центре экрана, а не там, где он загружен. –

Смежные вопросы