expand collaps

## dhtmlXGridObject object API

### initialization

setColumnsVisibility(...) [Professional]
set list of visible/hidden columns
File required:dhtmlxgrid.js

### rows control

getSelectedRowId()
gets selected row id
File required:dhtmlxgrid.js
Returns:id of selected row (list of ids with default delimiter) or null if non row selected
selectRow(r, fl, preserve, show)
selects row (and first cell of it)
File required:dhtmlxgrid.js
- r - row index or row object
- fl - if true, then call function on select
- preserve - preserve previously selected rows true/false (false by default)
- show - true/false - scroll row to view, true by defaul
selectRowById(row_id, multiFL, show, call)
selects row by ID
File required:dhtmlxgrid.js
- row_id - row id
- multiFL - VOID. select multiple rows
- show - true/false - scroll row to view, true by defaul
- call - true to call function on select

### colums control

enableHeaderImages(fl)
specify if values passed to Header are images file names
File required:dhtmlxgrid.js
- fl - true to treat column header values as image names
getColType(cInd)
get column type by column index
File required:dhtmlxgrid.js
- cInd - column index
Returns:type code
getColTypeById(cID)
get column type by column ID
File required:dhtmlxgrid.js
- cID - column id
Returns:type code
setColAlign(alStr)
set align of values in columns
File required:dhtmlxgrid.js
- alStr - list of align values (possible values are: right,left,center,justify). Default delimiter is ","
setColSorting(sortStr)
set column sort types (avaialble: str, int, date, na or function object for custom sorting)
File required:dhtmlxgrid.js
- sortStr - sort codes list with default delimiter
setColTypes(typeStr)
set column types
File required:dhtmlxgrid.js
- typeStr - type codes list (default delimiter is ",")
setColVAlign(valStr)
set vertical align of columns
File required:dhtmlxgrid.js
- valStr - vertical align values list for columns (possible values are: baseline,sub,super,top,text-top,middle,bottom,text-bottom)
setHeader(hdrStr, splitSign, styles)
set header label and default params for new headers
File required:dhtmlxgrid.js
- hdrStr - header string with delimiters
- splitSign - string used as a split marker, optional. Default is "#cspan"
- styles - array of header styles
sortTreeRows(...) [Professional]
sorts treegrid by specified column
File required:dhtmlxtreegrid.js

### cells controll

getColType(cInd)
get column type by column index
File required:dhtmlxgrid.js
- cInd - column index
Returns:type code
getColTypeById(cID)
get column type by column ID
File required:dhtmlxgrid.js
- cID - column id
Returns:type code
getCombo(col_ind)
gets Combo object of specified column. Use it to change select box value for cell before editor opened
File required:dhtmlxgrid.js
- col_ind - index of the column to get combo object for
getSelectedCellIndex()
gets index of selected cell
File required:dhtmlxgrid.js
Returns:index of selected cell or -1 if there is no selected sell
selectAll()
select all rows in grid, it doesn't fire any events
File required:dhtmlxgrid.js
- edit - switch selected cell to edit mode
selectCell(r, cInd, fl, preserve, edit, show)
set selection to specified row-cell
File required:dhtmlxgrid.js
- r - row object or row index
- cInd - cell index
- [fl] - true if to call onRowSelect function
- preserve - preserve previously selected rows true/false (false by default)
- edit - switch selected cell to edit mode
- show - true/false - scroll row to view, true by defaul
setColSorting(sortStr)
set column sort types (avaialble: str, int, date, na or function object for custom sorting)
File required:dhtmlxgrid.js
- sortStr - sort codes list with default delimiter
setColTypes(typeStr)
set column types
File required:dhtmlxgrid.js
- typeStr - type codes list (default delimiter is ",")

### data manipulation

copyRowContent(from_row_id, to_row_id)
copies row content to another existing row
File required:dhtmlxgrid.js
- from_row_id - id of the row to copy content from
- to_row_id - id of the row to copy content to
getUserData(row_id, name)
gets user Data
File required:dhtmlxgrid.js
- row_id - row id. if empty then user data is for grid (not row)
- name - name of user data
Returns:value of user data
setSerializableColumns(...) [Professional]
configure which column must be serialized (if you do not use this method, then all columns will be serialized)
File required:dhtmlxgrid.js
setSerializationLevel(...) [Professional]
configure XML serialization
File required:dhtmlxgrid.js
setUserData(row_id, name, value)
sets user data to row
File required:dhtmlxgrid.js
- row_id - row id. if empty then user data is set for grid (not row)
- name - name of user data block
- value - value of user data block
sortTreeRows(...) [Professional]
sorts treegrid by specified column
File required:dhtmlxtreegrid.js

### appearence control

enableAlterCss(cssE, cssU, perLevel, levelUnique)
set even/odd css styles
File required:dhtmlxgrid.js
- cssE - name of css class for even rows
- cssU - name of css class for odd rows
- perLevel - true/false - mark rows not by order, but by level in treegrid
- levelUnique - true/false - creates additional unique css class based on row level
setCellTextStyle(row_id, ind, styleString)
sets style to cell
File required:dhtmlxgrid.js
- row_id - row id
- ind - cell index
- styleString - style string in common format (exmpl: "color:red;border:1px solid gray;")
setColumnColor(clr)
colorize columns background.
File required:dhtmlxgrid.js
- clr - colors list
setColumnLabel(c, label, ind)
sets new column header label
File required:dhtmlxgrid.js
- col - header column index
- label - new label for the cpecified header's column. Can contai img:[imageUrl]Text Label
- ind - header row index (default is 0)
setRowColor(row_id, color)
sets background color of row (via bgcolor attribute)
File required:dhtmlxgrid.js
- row_id - row id
- color - color value
setRowTextBold(row_id)
sets row text BOLD
File required:dhtmlxgrid.js
- row_id - row id
setRowTextNormal(row_id)
sets row text weight to normal
File required:dhtmlxgrid.js
- row_id - row id
setRowTextStyle(row_id, styleString)
sets style to row
File required:dhtmlxgrid.js
- row_id - row id
- styleString - style string in common format (exmpl: "color:red;border:1px solid gray;")
setSkin(name)
set one of predefined css styles (xp, mt, gray, light, clear, modern)
File required:dhtmlxgrid.js
- name - style name
setStyle(ss_header, ss_grid, ss_selCell, ss_selRow)
modify default style of grid and its elements. Call before or after Init
File required:dhtmlxgrid.js
- ss_header - style def. expression for header
- ss_grid - style def. expression for grid cells
- ss_selCell - style def. expression for selected cell
- ss_selRow - style def. expression for selected Row

### overal control

attachToObject(obj)
attach grid to some object in DOM
File required:dhtmlxgrid.js
- obj - object to attach to
clearAll(header)
deletes all rows in grid
File required:dhtmlxgrid.js
- header - (boolean) enable/disable cleaning header
doesRowExist(row_id)
determines if row with specified id exists
File required:dhtmlxgrid.js
- row_id - row id
Returns:true if exists, false otherwise
enableMultiline(state)
set multiline rows support to enabled or disabled state
File required:dhtmlxgrid.js
- state - true or false
enableMultiselect(state)
set multiselect mode to enabled or disabled state
File required:dhtmlxgrid.js
- state - true or false
getAllRowIds(separator)
gets a list of all row ids in grid
File required:dhtmlxgrid.js
- separator - delimiter to use in list
Returns:list of all row ids in grid
getColWidth(ind)
gets width of specified column in pixels
File required:dhtmlxgrid.js
- ind - column index
Returns:column width in pixels
getColumnsNum()
gets number of columns in grid
File required:dhtmlxgrid.js
Returns:number of columns in grid
init(fl)
initialize grid
File required:dhtmlxgrid.js
- fl - if to parse on page xml data island
serialize(...) [Professional]
get actual xml of grid. The depth of serialization can be set with setSerializationLevel method
File required:dhtmlxgrid.js
setColWidth(ind, value)
sets width of specified column in pixels (soen't works with procent based grid)
File required:dhtmlxgrid.js
- ind - column index
- value - new width value
setIconPath(path)
set path to external images used in grid ( tree and img column types )
File required:dhtmlxgrid.js
- path - url (or relative path) of images folder with closing "/"
setImagePath(path)
set path to grid internal images (sort direction, any images used in editors, checkbox, radiobutton)
File required:dhtmlxgrid.js
- path - url (or relative path) of images folder with closing "/"
setInitWidths(wp)
set width of columns in pixels
File required:dhtmlxgrid.js
- wp - list of column width in pixels
setInitWidthsP(wp)
set width of columns in percents
File required:dhtmlxgrid.js
- wp - list of column width in percents
setNoHeader(fl)
create grid with no header. Call before initialization, but after setHeader. setHeader have to be called in any way as it defines number of columns
File required:dhtmlxgrid.js
- fl - true to use no header in the grid
setSerializableColumns(...) [Professional]
configure which column must be serialized (if you do not use this method, then all columns will be serialized)
File required:dhtmlxgrid.js
setSerializationLevel(...) [Professional]
configure XML serialization
File required:dhtmlxgrid.js
showRow(rowID)
scrolls row to the visible area
File required:dhtmlxgrid.js
- rowID - row id

### treegrid

clearAll(header)
deletes all rows in grid
File required:dhtmlxgrid.js
- header - (boolean) enable/disable cleaning header
clearSelection()
removes selection from the grid
File required:dhtmlxgrid.js
getSelectedRowId()
gets selected row id
File required:dhtmlxgrid.js
Returns:id of selected row (list of ids with default delimiter) or null if non row selected
preventIECaching(mode)
prevent caching in IE by adding random values to URL string
File required:dhtmlxgrid.js
- mode - enable/disable random values in URLs ( disabled by default )
setColspan(...) [Professional]
dynamicaly set colspan in row starting from specified column index
File required:dhtmlxgrid.js
sortTreeRows(...) [Professional]
sorts treegrid by specified column
File required:dhtmlxtreegrid.js

### event handlers

setOnOpenEndHandler(func)
set function called after tree node opened/closed
Event Name:onOpenEnd
Event raised immideatly after item in tree got command to open/close , and before item was opened//closed. Event also raised for unclosable nodes and nodes without open/close functionality - in that case result of function will be ignored.
- ID of node which will be opened/closed
- Current open state of tree item. -1 - item closed, 1 - item opened.
File required:dhtmlxtreegrid.js
- func - event handling function
setOnOpenStartHandler(func)
set function called before tree node opened/closed
Event Name:onOpenStart
Event raised immideatly after item in tree got command to open/close , and before item was opened//closed. Event also raised for unclosable nodes and nodes without open/close functionality - in that case result of function will be ignored.
- ID of node which will be opened/closed
- Current open state of tree item. -1 - item closed, 1 - item opened.
Event returns:true - confirm opening/closing; false - deny opening/closing;
File required:dhtmlxtreegrid.js
- func - event handling function

## eXcell object API

## eXcell_ed object API

## eXcell_edtxt object API

## eXcell_edn object API

## eXcell_ch object API

## eXcell_ra object API

## eXcell_txt object API

## eXcell_txttxt object API

## eXcell_co object API

## eXcell_coro object API

## eXcell_cp object API

## eXcell_img object API

## eXcell_price object API

## eXcell_dyn object API

## eXcell_ro object API

## eXcell_rotxt object API

## eXcell_tree object API

getLabel(val)
sets text representation of cell ( setLabel doesn't triger math calculations as setValue do)
File required:dhtmlxtreegrid.js
- val - new value
setLabel(val)
sets text representation of cell ( setLabel doesn't triger math calculations as setValue do)
File required:dhtmlxtreegrid.js
- val - new value