expand collaps

## dhtmlxFolders object API

clearAll()
clears Folders content
File required:dhtmlxfolders.js
config(data)
set config parameters to Folders
File required:dhtmlxfolders.js
- data - object containing pair of parameter/value (list of possible parameters: editable, ...)
deleteItem(id)
delete item(s)
File required:dhtmlxfolders.js
- id - id (or array of ids) of item to delete
enableContextMenu(menu)
enable/disable context menu
Topic(s):
File required:dhtmlxfolders_drag.js
- menu object, if null - context menu will be disabled
enableDragAndDrop(mode)
enables drag-n-drop in Folders
File required:dhtmlxfolders_drag.js
- mode - true/false
enableEditMode(state)
turns on/off edit mode for dhtmlxFolders object
File required:dhtmlxfolders.js
- newPath - new base directory path
enablePaging(itemsPerPage,withDynLoading)
enables/disables paging in Folders and sets number of items per page to use
File required:dhtmlxfolders.js
- itemsPerPage - number of items per page, or (if 0) disable paging
- withDynLoading - true to allow dynamical loading
filterClear(skip_redraw)
clears all filters
File required:dhtmlxfolders.js
filterItems(filterFunc,mask,preservePrevious)
filter items using filterFunc and mask
File required:dhtmlxfolders.js
- filterFunc - function to use to define if item should appear or not. if this function returns true, then item will be visible. Incomming arguments are: item object and mask
- mask - mask to use in filter
- preservePrevious - preserver previously applied filters
forEachSelected(func)
?
File required:dhtmlxfolders.js
getCurrentPage()
get currently opened page index (1 based)
File required:dhtmlxfolders.js
Returns:numeric value - 1 based page index
getItemDataObject(itemId)
returns data object item based on (it can be XML node or json object or other type of object, depending on datasource which was used).
File required:dhtmlxfolders.js
- itemId - id of item to get data object from
getItemsNum()
gets number of items currently known to Folders object (it can be chnaged then if dynamical loading is allowed)
File required:dhtmlxfolders.js
Returns:numeric value - number of items
getNumberOfPages()
gets number of pages in paging
File required:dhtmlxfolders.js
Returns:numeric value - number of pages
getSelectedId()
get selected item(s) id
File required:dhtmlxfolders.js
goToPage(pageNumber)
opens specified page if paging enabled
File required:dhtmlxfolders.js
- pageNumber - 1 based index of page to open
loadXML(url,xslFileURL)
populates Folders from XML file
File required:dhtmlxfolders.js
- url - xml file URL
loadXMLString(xmlString,xslFileURL)
populates Folders from XML String
File required:dhtmlxfolders.js
- xmlString - xml string
moveItem(sid,mode,tid,sObj,tObj)
moves item
File required:dhtmlxfolders.js
- sid - source item id
- mode - mode of movement (next, before, in)
- tid - target item id
- sObj - source object (if not specified then current Folders object)
- tObj - target object (if not specified then current Folders object)
setCSSBaseName(cssBaseName)
set some name to be used in top css class name for Folders Item by the following schema: dhx_folders_[CSSBASENAME_]item
File required:dhtmlxfolders.js
setImagePath(newPath)
sets new base dir for images used
File required:dhtmlxfolders.js
- newPath - new base directory path
setItemType(name,xslUrl)
define type of items (see among defined types)
File required:dhtmlxfolders.js
- name - name of type (if user defined xml-xsl type, them use "xml_generic")
- xslUrl - url of xsl file to use for this type (if user defined types, then this is the only different parameter when chnaging from one type to another )
setUserData(name,value)
sets userdata pair - name-value (if you use global variable with same name in xsl file, then it's value will be set to the value of userdata with this name)
File required:dhtmlxfolders.js
- name - userdata block name
- value - value of userdata block
sortItems(sortFunc,order)
sort items
File required:dhtmlxfolders.js
- sortFunc - custom function used for comparing two values. it gets 2 objects for comparison and must return positive int if necessary property of first ojects "bigger", 0 if they are equel for both and negative if second obj property is "bigger"
- order - direction (0 or 1)
unselectAll()
clear selection in Folders
File required:dhtmlxfolders.js