expandcollaps

dhtmlXGridObject object API

addRow(new_id,text,ind)
adds row to the specified position
Topic(s): rows control;
File required:dhtmlxGrid.js
  • new_id - id for new row
  • text - Array of values or String(with delimiter as in delimiter parameter)
  • [ind] - index of row (0 by default)

  • Returns:new row dom object
    attachToObject(obj)
    attach this grid to some object in DOM
    Topic(s): initialization; overal grid control;
    File required:dhtmlxGrid.js
  • obj - object to attach to
  • cells(row_id,col)
    gets dhtmlXGridCellObject object (if no arguments then gets dhtmlXGridCellObject object of currently selected cell)
    Topic(s): cells controll;
    File required:dhtmlxGrid.js
  • row_id - row id
  • col - column index

  • Returns:dhtmlXGridCellObject object (see its methods below)
    cells2(row_index,col)
    gets dhtmlXGridCellObject object
    Topic(s): cells controll;
    File required:dhtmlxGrid.js
  • row_index - row index
  • col - column index

  • Returns:dhtmlXGridCellObject object (see its methods below)
    clearAll()
    deletes all rows in grid
    Topic(s): data manipulation; overal grid control; treegrid;
    File required:dhtmlxGrid.js
    clearSelection()
    removes selection from the grid
    Topic(s): selection control; treegrid;
    File required:dhtmlxGrid.js
    copyRowContent(from_row_id, to_row_id)
    copies row content to another existing row
    Topic(s): rows control; data manipulation;
    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
  • deleteRow(row_id)
    deletes row
    Topic(s): rows control; treegrid;
    File required:dhtmlxGrid.js
  • row_id - id of row to delete
  • deleteSelectedItem()
    deletes selected row(s)
    Topic(s): rows control;
    File required:dhtmlxGrid.js
    doDynScroll(fl)
    dynamicaly scrolls grid content.
    Topic(s): initialization; appearence control; overal grid control; treegrid;
    File required:dhtmlxGrid.js
  • fl - if no fl - initializes dynamic scroll, if 'up' - scroll page up, if 'dn' - scrolls page down
  • editCell()
    creates Editor object and switch cell to edit mode if allowed
    Topic(s): cells controll;
    File required:dhtmlxGrid.js
    editStop()
    gets value from editor(if presents) to cell and closes editor
    Topic(s): cells controll;
    File required:dhtmlxGrid.js
    enableBuffering(bufferSize)
    enables buffering in content rendering. Using this you decrease the grid loading time.
    Topic(s): initialization; overal grid control;
    File required:dhtmlxGrid.js
    enableMultiline(state)
    set multiline rows support to enabled or disabled state
    Topic(s): initialization; overal grid control;
    File required:dhtmlxGrid.js
  • state - true or false
  • enableMultiselect(state)
    set multiselect mode to enabled or disabled state
    Topic(s): initialization; overal grid control;
    File required:dhtmlxGrid.js
  • state - true or false
  • getAllItemIds(separator)
    gets a list of all row ids in grid
    Topic(s): rows control; overal grid control;
    File required:dhtmlxGrid.js
  • separator - delimiter to use in list

  • Returns:list of all row ids in grid
    getColIndexById(id)
    gets column index by column id
    Topic(s): colums control;
    File required:dhtmlxGrid.js
  • id - column id

  • Returns:index of the column
    getColumnCount()
    gets number of columns in grid
    Topic(s): colums control; overal grid control;
    File required:dhtmlxGrid.js
    Returns:number of columns in grid
    getColumnId(cin)
    gets column id of column specified by index
    Topic(s): colums control;
    File required:dhtmlxGrid.js
  • cin - column index

  • Returns:column id
    getColWidth(ind)
    gets width of specified column in pixels
    Topic(s): colums control; overal grid control;
    File required:dhtmlxGrid.js
  • ind - column index

  • Returns:column width in pixels
    getCombo(col_ind)
    gets Combo object of specified column
    Topic(s): colums control; cells controll;
    File required:dhtmlxGrid.js
  • col_ind - index of the column to get combo object for
  • getRowId(ind)
    gets row id by index
    Topic(s): rows control;
    File required:dhtmlxGrid.js
  • ind - row index

  • Returns:row id or null if there is no row with specified index
    getRowIndex(row_id)
    gets row index by id (grid only)
    Topic(s): rows control;
    File required:dhtmlxGrid.js
  • row_id - row id

  • Returns:row index or -1 if there is no row with specified id
    getRowsNum()
    gets number of rows in grid
    Topic(s): rows control; overal grid control;
    File required:dhtmlxGrid.js
    Returns:number of rows in grid
    getSelectedCellIndex()
    gets index of selected cell
    Topic(s): selection control; cells controll;
    File required:dhtmlxGrid.js
    Returns:index of selected cell or -1 if there is no selected sell
    getSelectedId()
    gets selected row id
    Topic(s): selection control; rows control; treegrid;
    File required:dhtmlxGrid.js
    Returns:id of selected row (list of ids with default delimiter) or null if non row selected
    getUserData(row_id,name)
    gets user Data
    Topic(s): rows control; data manipulation;
    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
    init(fl)
    initialize grid
    Topic(s): initialization; overal grid control;
    File required:dhtmlxGrid.js
  • fl - if to parse on page xml dataisland
  • isItemExists(row_id)
    determines if row with specified id exists
    Topic(s): rows control; overal grid control;
    File required:dhtmlxGrid.js
  • row_id - row id

  • Returns:true if exists, false otherwise
    moveRowDown(row_id)
    moves row one position down if possible
    Topic(s): rows control;
    File required:dhtmlxGrid.js
  • row_id - row id
  • moveRowUp(row_id)
    moves row one position up if possible
    Topic(s): rows control;
    File required:dhtmlxGrid.js
  • row_id - row id
  • parseXML(xml,startIndex)
    populate grid with data from xml file (if passed parameter contains '.') or island
    Topic(s): rows control; data manipulation;
    File required:dhtmlxGrid.js
  • [xml] - xml island will be found by grid id (id_xml) if no file or island id is specified. This also can be ready-to-use XML object
  • [startIndex] - index of row in grid to start insertion from
  • selectCell(r,cInd,fl)
    set selection to specified row-cell
    Topic(s): selection control; cells controll;
    File required:dhtmlxGrid.js
  • r - row object or row index
  • cInd - cell index
  • [fl] - true if to call onRowSelect function
  • selectRow(r,fl)
    selects row (and first cell of it)
    Topic(s): selection control; rows control;
    File required:dhtmlxGrid.js
  • r - row index or row object
  • fl - if true, then call function on select
  • setColAlign(alStr)
    set align of columns
    Topic(s): initialization; colums control;
    File required:dhtmlxGrid.js
  • alStr - align string with delimiters
  • setColSorting(sortStr)
    set column sort types (avaialble: str, int, date, na)
    Topic(s): initialization; colums control; cells controll;
    File required:dhtmlxGrid.js
  • sortStr - sort codes list with default delimiter
  • setColTypes(typeStr)
    set column types
    Topic(s): initialization; colums control; cells controll;
    File required:dhtmlxGrid.js
  • typeStr - type codes list with default delimiter
  • setColumnColor(clr)
    colorize columns.
    Topic(s): colums control; appearence control;
    File required:dhtmlxGrid.js
  • clr - colors list
  • setColumnIds(ids)
    sets ids to every column. Can be used then to retreive the index of the desired colum
    Topic(s): colums control;
    File required:dhtmlxGrid.js
  • [ids] - "," delimitered list of ids, or empty if to use values set earlier
  • setDelimiter(delim)
    set default delimiter
    Topic(s): initialization;
    File required:dhtmlxGrid.js
  • delim - delimiter as string
  • setEditable(fl)
    manage editibility of the grid
    Topic(s): overal grid control;
    File required:dhtmlxGrid.js
  • [fl] - set not editable if FALSE, set editable otherwise
  • setHeader(hdrStr)
    set header label and default params for new headers
    Topic(s): initialization; colums control;
    File required:dhtmlxGrid.js
  • hdrStr - header string with delimiters
  • setHeaderCol(col,label)
    sets new column header label
    Topic(s): colums control; appearence control;
    File required:dhtmlxGrid.js
  • col - header column index
  • label - new label for the cpecified header's column
  • setImagePath(path)
    set path to grid internal images (sort direction, any images used in editors, checkbox, radiobutton)
    Topic(s): initialization; overal grid control;
    File required:dhtmlxGrid.js
  • path - path to images folder with closing "/"
  • setInitWidths(wp)
    set width of columns in pixels
    Topic(s): initialization; overal grid control;
    File required:dhtmlxGrid.js
  • wp - width in pixels
  • setInitWidthsP(wp)
    set width of columns in percents
    Topic(s): initialization; overal grid control;
    File required:dhtmlxGrid.js
  • wp - width in percents
  • setMultiLine(fl)
    sets grid to multiline row support (call before init)
    Topic(s): initialization; rows control;
    File required:dhtmlxGrid.js
  • fl - true to set multiline support
  • setMultiselect(fl)
    allow multiselection
    Topic(s): initialization; rows control; overal grid control;
    File required:dhtmlxGrid.js
  • fl - false/true
  • setNoHeader(fl)
    use to create grid with no header
    Topic(s): initialization; overal grid control;
    File required:dhtmlxGrid.js
  • fl - true to use no header in the grid
  • setOnCheckHandler(func)
    set function called when checkbox or radiobutton was clicked

    EventName:onCheck
    Event raises after state was changed.
  • ID or row
  • index of cell
  • state of checkbox/radiobutton
  • Topic(s): event handlers;
    File required:dhtmlxGrid.js
  • func - event handling function (or its name)
  • setOnEditCellHandler(func)
    set function called when cell editted

    EventName:onEditCell
    Event raises 1-3 times depending on cell editibality.
  • stage of editting (0-before start[can be canceled if returns false],1-editor opened,2-editor closed)
  • ID or row
  • index of cell
  • Topic(s): event handlers;
    File required:dhtmlxGrid.js
  • func - event handling function (or its name)
  • setOnEnterPressedHandler(func)
    set function called when user press Enter

    EventName:onEnterPressed
    Event raised immideatly after Enter pressed.
  • ID or row
  • index of cell
  • Topic(s): event handlers;
    File required:dhtmlxGrid.js
  • func - event handling function (or its name)
  • setOnRowSelectHandler(func)
    set function called when row selected

    EventName:onRowSelect
    Event raised immideatly after row was clicked.
  • ID of clicked row
  • Topic(s): event handlers;
    File required:dhtmlxGrid.js
  • func - event handling function (or its name)
  • setRowId(ind,row_id)
    sets new id for row by its index
    Topic(s): rows control;
    File required:dhtmlxGrid.js
  • ind - row index
  • row_id - new row id
  • setRowTextBold(row_id)
    sets row text BOLD
    Topic(s): rows control; appearence control;
    File required:dhtmlxGrid.js
  • row_id - row id
  • setRowTextNormal(row_id)
    sets row text NORMAL
    Topic(s): rows control; appearence control;
    File required:dhtmlxGrid.js
  • row_id - row id
  • setRowTextStyle(row_id,styleString)
    sets style to row
    Topic(s): rows control; appearence control;
    File required:dhtmlxGrid.js
  • row_id - row id
  • styleString - style string in common format (exmpl: "color:red;border:1px solid gray;")
  • setSelectedRow(row_id, multiFL,show,call)
    selects row
    Topic(s): selection control; rows control;
    File required:dhtmlxGrid.js
  • row_id - row id
  • multiFL - VOID. select multiple rows
  • show - VOID. scroll row to view
  • call - true to call function on select
  • setStyle(ss_header,ss_grid,ss_selCell,ss_selRow)
    modify default style of grid and its elements. Call before or after Init
    Topic(s): initialization; appearence control;
    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
  • setUserData(row_id,name,value)
    sets user Data
    Topic(s): rows control; data manipulation;
    File required:dhtmlxGrid.js
  • row_id - row id. if empty then user data is for grid (not row)
  • name - name of user data
  • value - value of user data
  • setXMLAutoLoading(filePath,bufferSize)
    enables the possibility to load content from server when already loaded content was rendered. Using this you decrease the grid loading time for extremely big amounts of data.
    Topic(s): initialization; overal grid control;
    File required:dhtmlxGrid.js
    showRow(rowID)
    scrolls row to the visible area
    Topic(s): rows control; overal grid control;
    File required:dhtmlxGrid.js
  • rowID - row id
  • sortRows(col,type,order)
    sorts specified column
    Topic(s): rows control; colums control; data manipulation; treegrid;
    File required:dhtmlxGrid.js
  • col - column index
  • type - str.int.date
  • order - asc.desc
  • dhtmlXGridCellObject object API

    getBgColor()
    determ. cell's background color

    File required:dhtmlxGridCell.js
    Returns:cell's background color
    getFont()
    determ. font style if it was set

    File required:dhtmlxGridCell.js
    Returns:font name only if it was set for the cell
    getHorAlign()
    determines horisontal align od the cell

    File required:dhtmlxGridCell.js
    Returns:horisontal align of cell content
    getTextColor()
    determ. cell's text color

    File required:dhtmlxGridCell.js
    Returns:cell's text color
    getValue()
    gets Value of cell

    File required:dhtmlxGridCell.js
    getWidth()
    gets width of the cell in pixel

    File required:dhtmlxGridCell.js
    Returns:width of the cell in pixels
    isCheckbox()
    determines whether first child of the cell is checkbox or radio

    File required:dhtmlxGridCell.js
    Returns:true if first child of the cell is input element of type radio or checkbox
    isChecked()
    determines whether radio or checkbox inside is checked

    File required:dhtmlxGridCell.js
    Returns:true if first child of the cell is checked
    isDisabled()
    determines whether cell content (radio,checkbox) is disabled

    File required:dhtmlxGridCell.js
    Returns:true if first child of the cell is disabled
    setBgColor(val)
    sets background color to the cell

    File required:dhtmlxGridCell.js
  • val - color value (name or hex)
  • setChecked(fl)
    checks checkbox or radion

    File required:dhtmlxGridCell.js
  • fl - true or false
  • setDisabled(fl)
    disables radio or checkbox

    File required:dhtmlxGridCell.js
  • fl - true or false
  • setFont(val)
    sets font family to the cell

    File required:dhtmlxGridCell.js
  • val - string in format: Arial-bold(italic,bolditalic)-12px
  • setHorAlign(val)
    sets horisontal align to the cell

    File required:dhtmlxGridCell.js
  • val - value in single-letter or full format(exmp: r or right)
  • setTextColor(val)
    sets text color to the cell

    File required:dhtmlxGridCell.js
  • val - color value (name or hex)
  • setValue(val)
    sets value to the cell

    File required:dhtmlxGridCell.js
  • val - new value
  • wasChanged()
    determines whether cell value was changed

    File required:dhtmlxGridCell.js
    Returns:true if cell value was changed, otherwise - false

    eXcell object API

    getBgColor()
    determ. cell's background color

    Nested from:dhtmlXGridCellObject
    File required:dhtmlxGridCell.js
    Returns:cell's background color
    getFont()
    determ. font style if it was set

    Nested from:dhtmlXGridCellObject
    File required:dhtmlxGridCell.js
    Returns:font name only if it was set for the cell
    getHorAlign()
    determines horisontal align od the cell

    Nested from:dhtmlXGridCellObject
    File required:dhtmlxGridCell.js
    Returns:horisontal align of cell content
    getTextColor()
    determ. cell's text color

    Nested from:dhtmlXGridCellObject
    File required:dhtmlxGridCell.js
    Returns:cell's text color
    getValue()
    gets Value of cell

    Nested from:dhtmlXGridCellObject
    File required:dhtmlxGridCell.js
    getWidth()
    gets width of the cell in pixel

    Nested from:dhtmlXGridCellObject
    File required:dhtmlxGridCell.js
    Returns:width of the cell in pixels
    isCheckbox()
    determines whether first child of the cell is checkbox or radio

    Nested from:dhtmlXGridCellObject
    File required:dhtmlxGridCell.js
    Returns:true if first child of the cell is input element of type radio or checkbox
    isChecked()
    determines whether radio or checkbox inside is checked

    Nested from:dhtmlXGridCellObject
    File required:dhtmlxGridCell.js
    Returns:true if first child of the cell is checked
    isDisabled()
    determines whether cell content (radio,checkbox) is disabled

    Nested from:dhtmlXGridCellObject
    File required:dhtmlxGridCell.js
    Returns:true if first child of the cell is disabled
    setBgColor(val)
    sets background color to the cell

    Nested from:dhtmlXGridCellObject
    File required:dhtmlxGridCell.js
  • val - color value (name or hex)
  • setChecked(fl)
    checks checkbox or radion

    Nested from:dhtmlXGridCellObject
    File required:dhtmlxGridCell.js
  • fl - true or false
  • setDisabled(fl)
    disables radio or checkbox

    Nested from:dhtmlXGridCellObject
    File required:dhtmlxGridCell.js
  • fl - true or false
  • setFont(val)
    sets font family to the cell

    Nested from:dhtmlXGridCellObject
    File required:dhtmlxGridCell.js
  • val - string in format: Arial-bold(italic,bolditalic)-12px
  • setHorAlign(val)
    sets horisontal align to the cell

    Nested from:dhtmlXGridCellObject
    File required:dhtmlxGridCell.js
  • val - value in single-letter or full format(exmp: r or right)
  • setTextColor(val)
    sets text color to the cell

    Nested from:dhtmlXGridCellObject
    File required:dhtmlxGridCell.js
  • val - color value (name or hex)
  • setValue(val)
    sets value to the cell

    Nested from:dhtmlXGridCellObject
    File required:dhtmlxGridCell.js
  • val - new value
  • wasChanged()
    determines whether cell value was changed

    Nested from:dhtmlXGridCellObject
    File required:dhtmlxGridCell.js
    Returns:true if cell value was changed, otherwise - false

    dhtmlXGridComboObject object API

    clear()
    clears combobox

    File required:dhtmlxGridCell.js
    get(key)
    gets value corresponding to the given key

    File required:dhtmlxGridCell.js
  • key - object to use as a key (should be a string in the case of combobox)

  • Returns:value correspond. to given key or null if no such key
    getKeys()
    gets array of all available keys present in combobox

    File required:dhtmlxGridCell.js
    Returns:array of all available keys
    put(key,value)
    puts new combination of key and value into combobox

    File required:dhtmlxGridCell.js
  • key - object to use as a key (should be a string in the case of combobox)
  • value - object value of combobox line
  • remove(key)
    remove pair of key-value from combobox with given key

    File required:dhtmlxGridCell.js
  • key - object to use as a key
  • size()
    gets the size of combobox

    File required:dhtmlxGridCell.js
    Returns:current size of combobox