DHTMLX Docs & Samples Explorer

Index
dhtmlxtree
List of initialization properties

## List of initialization properties

### Common initialization options

- parent - string or object, id of container, where tree will be initialized, mandatory
- image_path - string, path to image folder, which will be used for icons in tree
- width - {string} width of tree, can be defined in pixels or in percents
- height - {string} height of tree, can be defined in pixels or in percents
- root_id - {string} id of virtual root item

- checkbox - {boolean}, show/hide checkboxes (all checkboxes in tree) ( enableCheckBoxes )
- checkbox_3_state - {boolean}, enable three state checkboxes ( enableThreeStateCheckboxes )
- context_menu - context menu object, enable context menu ( enableContextMenu )
- multiline - {boolean}, enable multi line items ( enableMultiLineItems )
- multiselect - {boolean}, enable multiselection ( enableMultiselection )
- editor - {boolean}, enable editing of item text ( enableItemEditor )
- hover - {boolean}, enable item highlighting (item text highlited on mouseover) ( enableHighlighting )
- smart_parsing - {boolean}, enable/disable smart XML parsing mode (usefull for big, well structured XML) ( enableSmartXMLParsing )
- xml - {string}, url of data xml file

### Drag and Drop

- drag - {boolean}, enable/disable drag-and-drop ( enableDragAndDrop )
- drag_copy - {boolean}, enable drag without removing (copy instead of move) ( enableMercyDrag )
- drag_image - {boolean}, enable draging item image with item text ( enableImageDrag )
- drag_scroll - {boolean}, enable/disable auto scrolling while drag-and-drop ( enableDragAndDropScrolling )

### Extensions

- auto_save_selected - {boolean}, enable/disable autosaving selected node in cookie ( enableAutoSavingSelected )
- auto_tooltip - {boolean}, enable auto tooltips (node text as tooltip) ( enableAutoTooltips )
- checkbox_smart - {boolean}, enable smart checkboxes ,true by default (auto checking children and parents for 3-state checkboxes) ( enableSmartCheckboxes )
- distributed_parsing - {boolean}, enable distributed parsing of big tree (items loaded portion by portion with some timeouts) ( enableDistributedParsing )
- images - {boolean}, enable tree images ( enableTreeImages )
- image_fix - {boolean}, replace IMG tag with background images - solve problem with IE image caching , not works for IE6 SP1 ( enableIEImageFix )
- lines - {boolean}, enable/disable tree lines (parent-child threads) ( enableTreeLines )
- loading_item - {boolean}, enable/disable “Loading…” item ( enableLoadingItem )
- navigation - {boolean}, enable keyboard navigation in tree ( enableKeyboardNavigation )
- radio - {boolean}, replace checkboxes with radio buttons ( enableRadioButtons )
- radio_single - {boolean}, replace checkboxes with radio buttons ( enableSingleRadioMode )
- rtl - {boolean}, enables Right-to-Left mode in tree ( enableRTL )
- search - {boolean}, enable search items by pressing keys (any item in tree should be focused/selected to make search work) ( enableKeySearch )
- smart_rendering - {boolean}, enables smart rendering mode (usefull for big trees with lots f items on each level) ( enableSmartRendering )
- text_icons - {boolean}, replace images with text signs ( enableTextSigns )

### Events

any event can be assigned by using property equal to event name

    	tree = new dhtmlXTreeObject({
    		parent:"a_tree",
    		onClick:function(){
    			alert("I'm clicked");
    		}
    	});