DHTMLX Docs & Samples Explorer

TreeDataItem

Nest all methods of DataItem Object

get_parent_id

method returns parent id of the selected item:

  $dataItem->get_parent_id();

set_image

method allows to set image for any item in tree:

  $dataItem->set_image($img)

Parameters:

  • $img - image which will be set for selected item

Can be use with variable number of parameters

  $dataItem->set_image($img1,$img2,$img3)

Parameters:

  • $img1 - image of folder in opened state
  • $img2 - image of folder in closed state
  • $img3 - image of leaf item

get_check_state

method returns the state of selected item:

    $dataItem->get_check_state();

Parameters:

  • $value -returns state of checkbox related to the item:

set_check_state

method allows to set state of checkbox related to the item:

    $dataItem->set_check_state($value);

Parameters:

  • $value - state of the item, valid valus are “0” - unchecked, “1” - checked, ”-1” - third state