-
Config
- barHeight
-
bbar
- bbarHeight
- bbarHidden
-
buttons
- buttonsHeight
- buttonsHidden
- cellHeaderHeight
- cellHeight
- cellStylingCls
- cellTrackOver
- cellWrapper
- clicksToEdit
- cls
- columnClickData
- columnLines
-
columns
- autoWidth
- align
- autoHeight
- cellAlign
- cellTip
- cls
- columns
-
data
- disallowAfterDrop
- displayKey
- draggable
- editable
- ellipsis
- exportFn
- exportable
-
filter
- flex
- format
- headerCheckBox
- headerClickSort
- headerCls
- headerCellTip
- headerLImageCls
- hidden
- id
- index
- itemCheckBox
-
items
- leftTpl
- leftWidth
- listItemTpl
- lockable
- locked
- maxWidth
- menu
- minEditorWidth
- minListWidth
- minWidth
- multiSelect
- precision
- render
- resizable
- rightLocked
- rowdrag
- searchable
- select
- selectable
- smartIndexFn
- sortable
- sorter
- sparkConfig
- spin
- step
- subSearch
- summary
- title
- titleEditable
- type
- valueKey
- values
- vtype
- width
- controllers
- columnTrackOver
- contextmenu
-
data
- defaults
- dirtyEnabled
- draggable
- droppable
- dropZone
- dropZoneFn
- doubleHorizontalScroll
- emptyText
-
events
- activate
- beforeedit
- beforeendedit
- cellclick
- celldblclick
- cellenter
- cellleave
- change
- changepage
- changepagesize
- columnclick
- columndblclick
- columndrag
- columnenter
- columnhide
- columnleave
- columnshow
- columnresize
- columntitlechange
- deactivate
- delay
- deselectrow
- dragrows
- dropitems
- endedit
- filter
- init
- insert
- headercellclick
- headercellenter
- headercellleave
- load
- lockcolumn
- remove
- rowclick
- rowdblclick
- rowenter
- rowleave
- select
- selectrow
- servererror
- set
- scope
- sort
- startedit
- unlockcolumn
- update
-
expander
- exporter
-
filter
- flexScrollSensitive
-
footer
-
gridToGrid
-
grouping
- height
- id
- infinite
- i18n
-
lang
- autoSizeColumn
- autoSizeColumns
- cancel
- columns
-
date
- decimalSeparator
- dragText
- loadingText
- lock
- no
- paging
- loadMask
- minHeight
- minWidth
- modal
- multiSort
- multiSortLimit
- nativeScroller
- paging
- renderOuter
- renderTo
- resizable
- rowEdit
- rowLines
- searching
- selModel
- shadow
- singleExpand
- state
- startEditByTyping
- stateful
- stateId
- striped
- subTBar
- allowToggle
- action
- cls
- data
- disabled
- displayKey
- editable
- emptyText
- enableToggle
- events
- format
- handler
- hidden
- id
- imageCls
- inputHeight
- itemCheckBox
- leftTpl
- leftWidth
- max
- menu
- minListWidth
- multiSelect
- multiToggle
- paramsMenu
- paramsText
- pressed
- spin
- step
- subSearch
- text
- tip
- toggleGroup
- type
- valueKey
- vtype
- width
- subTBarHeight
- subTBarHidden
- subHeaderFilter
- subTitle
- summary
- tabScrollStep
- tbar
- action
- allowToggle
- cls
- data
- disabled
- displayKey
- editable
- emptyText
- enableToggle
- events
- format
- handler
- hidden
- id
- imageCls
- inputHeight
- itemCheckBox
- leftTpl
- leftWidth
- max
- menu
- min
- minListWidth
- multiSelect
- multiToggle
- paramsMenu
- paramsText
- pressed
- spin
- step
- subSearch
- text
- tip
- toggleGroup
- type
- valueKey
- vtype
- width
- tbarHeight
- tbarHidden
- textSelection
- theme
- title
- Columns
- Events
- activate
- beforeedit
- beforeendedit
- cellclick
- celldblclick
- cellenter
- cellleave
- change
- changepage
- changepagesize
- columnclick
- columndblclick
- columndrag
- columnenter
- columnhide
- columnleave
- columnshow
- columnresize
- columntitlechange
- contextmenu
- deactivate
- deselectrow
- dragrows
- dropitems
- endedit
- filter
- init
- insert
- headercellclick
- headercellenter
- headercellleave
- load
- lockcolumn
- remove
- rowclick
- rowdblclick
- rowenter
- rowleave
- select
- selectrow
- servererror
- set
- sort
- startedit
- statechange
- unlockcolumn
- update
- Methods
- add
- addChild
- addColumn
- addEvent
- addFilter
- addGroup
- autoSizeColumns
- clearData
- clearDirty
- clearFilter
- clearGroup
- clearSelection
- collapse
- collapseAll
- collapseGroup
- copy
- deSelectRow
- destroy
- disableSelection
- each
- editCell
- enableSelection
- expand
- expandAll
- expandGroup
- exportToCSV
- exportToExcel
- find
- findItem
- fire
- firstPage
- flashCell
- flashRow
- get
- getById
- getCell
- getChanges
- getColumn
- getColumnById
- getColumns
- getData
- getDataAsCSV
- getDataFiltered
- getDataView
- getFilter
- getHeaderCell
- getHeight
- getPage
- getPages
- getPageSize
- getRowById
- getSelection
- getSorter
- getSubTitle
- getTitle
- getTotal
- getViewTotal
- getWidth
- hide
- hideBar
- hideColumn
- hideLoadMask
- isDirty
- isLoading
- insert
- lastPage
- load
- lockColumn
- nextPage
- on
- once
- prevPage
- redo
- remove
- removeAll
- removeAt
- removeColumn
- removeRow
- removeRowById
- rightLockColumn
- save
- scroll
- scrollToRow
- search
- selectCell
- selectCellDown
- selectCellLeft
- selectCellRight
- selectCellUp
- selectColumn
- selectRow
- set
- setById
- setColumnComboData
- setColumns
- setColumnTitle
- setColumnWidth
- setData
- setHeight
- setPage
- setPageSize
- setParams
- setSelModel
- setSubTitle
- setTitle
- setTrackOver
- setUrl
- setWidth
- show
- showAt
- showBar
- showColumn
- showLoadMask
- sort
- stopEditor
- stopSelection
- toggleCollapse
- toggleExpand
- un
- undo
- undoAll
- unLockColumn
- update
- updateFilters
combo
Combo column type
Example
columns: [{ ... index: 'country', title: 'Country', type: 'combo', data: ['USA', 'Canada', 'England'] ...
align
StringColumn header cell align.
... columns: [{ type: 'image', title: 'Photo', index: 'src', width: 80, align: 'center' },{ ...
left cellAlign
StringColumn cell align.
... columns: [{ type: 'image', title: 'Photo', index: 'src', width: 80, cellAlign: 'center' },{ ...
left cellTip
MixedColumn cell tooltip.
... columns: [{ type: 'number', width: 75, align: 'center', cellAlign: 'center', cellTip: '{title} sold {value}<br> items on {day}' },{ ...
... columns: [{ type: 'number', width: 75, align: 'center', cellAlign: 'center', cellTip: function(o){ if(!o.value){ return false; } return o.value; } },{ ...
If cellTip is function that it should return cell tip text, if it returns false than tip will not be shown.false cls
StringColumn css className.
.photo img { width: 80px; margin-top: -5px; margin-left: -10px; } ... columns: [{ type: 'image', title: 'Photo', index: 'src', width: 80, cls: 'photo' },{ ...
columnMenu
BooleanEnable/disable column for menu.
columns: [{ title: 'Company', index: 'name', columnMenu: false, type: 'string', width: 200, }, { text: 'Stock Price', columns: [{ title: 'Price', index: 'price' }, { title: 'Change', index: 'change', render: renderChangesFn }, { title: '% Change', index: 'pctChange', render: renderChangesFn }] }, { title: 'Last Updated', index: 'lastChange', type: 'string', width: 97 }] ...
undefined data
ArrayIt is used only for combo column.
Combo values.
{ index: 'country', title: 'Country', type: 'combo', data: ['USA', 'Canada', 'England'] }
Example: Dynamic loading from server
{ index: 'country', title: 'Country', type: 'combo', data: { proxy: { url: 'countries.php', method: 'POST' } } } ... countries.php {"data": ["USA", "Canada", "England"]}
Returned data from server must be valid JSON, in other case it will not be rendered
Data - array of objects
Local Data
{ index: 'country', title: 'Country', type: 'combo', displayKey: 'country', data: [ {country: "USA", id: 1}, {country: "Canada", id: 2}, {country: "England", id: 3} ] }
Server Data
{ index: 'country', title: 'Country', type: 'combo', displayKey: 'country', data: { proxy: { url: 'countries.php', method: 'POST' } } } ... countries.php {"data": [{"country": "USA", "id": 1},{"country": "Canada", id: 2},{"country": "England", id: 3}]}
Returned data from server must be valid JSON, in other case it will not be rendered
displayKey
StringIt is used only for combo. The data value name to display in grid cell, filter field and combo list.
columns: [{ ... },{ index: 'state', title: 'State', type: 'combo', width: 110, displayKey: 'text', valueKey: 'value', data: { proxy: { url: 'states.json' } } ... states.json { "data": [{ "value": "", "text": "" },{ "value": "AL", "text": "Alabama" },{ "value": "AK", "text": "Alaska" },{ "value": "AZ", "text": "Arizona"
draggable
BooleanAllows column to be dragged.
draggable: true,
false editable
BooleanEnable column editing.
{ type: 'string', width: 65, title: 'Name', index: 'name', editable: true }
False flex
NumberAuto-calc column width by fitting available width.
If to set one column to
1
than column width will fit to available grid width.If to set one column to
1
and another to2
than available width will be divided on 3.columns: [{ index: 'company', title: 'Company' },{ index: 'name', title: 'Name', sortable: true },{ index: 'surname', title: 'Sur Name' },{ index: 'age', title: 'Age', type: 'number', width: 50 },{ index: 'education', title: 'Education', flex: 1 }]
headerClickSort
BooleanIt is used only for columns that are sortable.
It prevents sorting by click on column header cell.
It is used for sorting outside of grid over grid API.{ index: 'company', type: 'string', title: 'Company', sortable: true, headerClickSort: false } ... grid.sort('company', 'asc');
undefined headerCls
StringIt is used only for checkbox column type.
Configure as true to display a checkbox below the header text.
Clicking the checkbox will check/uncheck all records.{ index: 'company', type: 'string', title: 'Company', headerCls: 'header-cell-company' }
undefined headerLImageCls
StringIn column header cell there is inactive left to title image.
If to set css class name than this image will become active..phone { display: inline-block; width: 19px; height: 16px; background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20style%3D%22shape-rendering%3AgeometricPrecision%22%20fill%3D%22%23555555%22%20%20opacity%3D%220.5%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20d%3D%22M6.2223%2C2.8573%20C6.4953%2C3.1303%206.4953%2C3.5723%206.2223%2C3.8453%20L5.2333%2C4.8333%20C4.9603%2C5.1063%205.0863%2C5.4653%205.2333%2C5.8213%20C5.5833%2C6.6653%206.3453%2C7.5103%207.4163%2C8.5813%20C8.6103%2C9.7763%209.3313%2C10.3323%2010.1753%2C10.7653%20C10.5193%2C10.9413%2010.8913%2C11.0383%2011.1633%2C10.7653%20L12.1523%2C9.7783%20C12.4253%2C9.5053%2012.8673%2C9.5053%2013.1403%2C9.7783%20L15.1173%2C11.7563%20C15.3903%2C12.0293%2015.3903%2C12.4713%2015.1173%2C12.7443%20L13.0653%2C14.7953%20C12.8233%2C15.0373%2012.4423%2C15.0683%2012.1643%2C14.8693%20C12.1643%2C14.8693%208.1363%2C13.6693%205.2333%2C10.7653%20C2.2063%2C7.7373%201.1303%2C3.8303%201.1303%2C3.8303%20C0.9313%2C3.5523%200.9633%2C3.1713%201.2043%2C2.9303%20L3.2573%2C0.8793%20C3.5303%2C0.6063%203.9723%2C0.6063%204.2453%2C0.8793%20L6.2223%2C2.8573%20Z%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E'); background-repeat: no-repeat; position: absolute; left: 2px; top: 7px; } ... },{ type: 'string', headerLImageCls: 'phone', cellAlign: 'right', sortable: false, title: 'Phone', index: 'phone' },{
undefined hidden
BooleanHide column on start.
{ index: 'married', resizable: true, type: 'checkbox', title: 'Married', width: 100, hidden: true }
false id
StringColumn id was added to solve cases when column does not have data index or data index is repeated on several columns.
If column id is not provided that it will be auto generated on base of column data index or random value.columns: [{ type: 'string', title: 'Name', index: 'name', id: 'name', width: 80, align: 'center' },{
Auto generation. index
String|NumberData index.
{ type: 'string', width: 65, title: 'Name', index: 'name', editable: true }
itemCheckBox
BooleanAdds checkboxes for filter header combo list.
},{ index: 'country', title: 'Country', type: 'combo', width: 99, filter: { header: true }, displayKey: 'text', valueKey: 'text', multiSelect: true, itemCheckBox: true, minListWidth: 120, data: { proxy: { url: '/json-data/theme/countries.json' } } },{
true leftTpl
StringTemplate for left input element.
This property is presented for only combo field.
... items: [{ width: 300, label: 'Phone', displayKey: 'country', valueKey: 'country', itemCheckBox: true, value: 'UK', emptyText: 'Select Language', leftTpl: '<span class="flag {cls}"></span><span class="phone-code">{code}</span>', leftWidth: 55, displayTpl: '<span class="flag {cls}"></span> <span class="phone-code">{code}</span> <span class="country">{country}</span>', listItemTpl: '<span class="flag {cls}"></span> <span class="phone-code">{code}</span> <span class="country">{country}</span>', data: [{ index: 'uk', country: 'UK', code: '+44', cls: 'flag-uk' },{ index: 'in', country: 'India', code: '+91', cls: 'flag-in' },{ index: 'usa', country: 'USA', code: '+1', cls: 'flag-usa' },{ index: 'ja', country: 'Japan', code: '+81', cls: 'flag-ja' }]; },{ ...
undefined leftWidth
NumberWidth for for left input element.
This property is presented for only combo field and requires leftTpl.
... items: [{ width: 300, label: 'Phone', displayKey: 'country', valueKey: 'country', itemCheckBox: true, value: 'UK', emptyText: 'Select Language', leftTpl: '<span class="flag {cls}"></span><span class="phone-code">{code}</span>', leftWidth: 55, displayTpl: '<span class="flag {cls}"></span> <span class="phone-code">{code}</span> <span class="country">{country}</span>', listItemTpl: '<span class="flag {cls}"></span> <span class="phone-code">{code}</span> <span class="country">{country}</span>', data: [{ index: 'uk', country: 'UK', code: '+44', cls: 'flag-uk' },{ index: 'in', country: 'India', code: '+91', cls: 'flag-in' },{ index: 'usa', country: 'USA', code: '+1', cls: 'flag-usa' },{ index: 'ja', country: 'Japan', code: '+81', cls: 'flag-ja' }]; },{ ...
20|0 leftTpl
StringThis property is used for only combo colomn.
listTpl
is template for left side of combo editor.This property is used for advanced templating combo.
Templating combos is one the most complex issue.columns: [{ index: 'country', title: 'Country', type: 'combo', displayKey: 'text', valueKey: 'text', minEditorWidth: 150, minListWidth: 150, leftTpl: '<span class="flag {cls}"></span> l ', leftWidth: 35, listItemTpl: '<span class="flag {cls}"></span> <span class="country">{text}</span>', render: function(o){ var cls = 'flag-' + coutries[o.value]; o.value = '<span class="flag ' + cls + '"></span> <span class="country">' + o.value + '</span>'; return o; }, data: { proxy: { url: 'countries.json' } } },{ ...
undefined leftWidth
NumberThis property is used for only combo colomn.
leftWidth
is width of left side of combo editor.
This property can be used only if propertyleftTpl
is defined.This property is used for advanced templating combo.
Templating combos is one the most complex issue.columns: [{ index: 'country', title: 'Country', type: 'combo', displayKey: 'text', valueKey: 'text', minEditorWidth: 150, minListWidth: 150, leftTpl: '<span class="flag {cls}"></span> l ', leftWidth: 35, listItemTpl: '<span class="flag {cls}"></span> <span class="country">{text}</span>', render: function(o){ var cls = 'flag-' + coutries[o.value]; o.value = '<span class="flag ' + cls + '"></span> <span class="country">' + o.value + '</span>'; return o; }, data: { proxy: { url: 'countries.json' } } },{ ...
20 listItemTpl
StringThis property is used for only combo colomn.
listItemTpl
is template for list item for combo editor.This property is used for advanced templating combo.
Templating combos is one the most complex issue.columns: [{ index: 'country', title: 'Country', type: 'combo', displayKey: 'text', valueKey: 'text', minEditorWidth: 150, minListWidth: 150, leftTpl: '<span class="flag {cls}"></span> l ', leftWidth: 35, listItemTpl: '<span class="flag {cls}"></span> <span class="country">{text}</span>', render: function(o){ var cls = 'flag-' + coutries[o.value]; o.value = '<span class="flag ' + cls + '"></span> <span class="country">' + o.value + '</span>'; return o; }, data: { proxy: { url: 'countries.json' } } },{ ...
undefined lockable
BooleanEnable/disable column locking.
locked: false,
true locked
BooleanLocking column.
{ type: 'string', width: 65, title: 'Name', index: 'name', locked: true }
False maxWidth
NumberThe maximum width of column.
maxWidth: 150,
menu
MixedEnables column menu.
menu: true,
Example: Custom Default menu
menu: ['sort', '-', 'columns', '-', 'lock'],
Example: Custom menu
menu: ['columns', '-', { text: 'Hi', handler: function(){ alert('Hi'); } }],
Example: One menu with columns only
menu: 'columns',
false minEditorWidth
NumberThis property is used for only combo colomn.
minEditorWidth
is min width of combo editor.
This property is used for advanced templating combo.
Templating combos is one the most complex issue.columns: [{ index: 'country', title: 'Country', type: 'combo', displayKey: 'text', valueKey: 'text', minEditorWidth: 150, minListWidth: 150, leftTpl: '<span class="flag {cls}"></span> l ', leftWidth: 35, listItemTpl: '<span class="flag {cls}"></span> <span class="country">{text}</span>', render: function(o){ var cls = 'flag-' + coutries[o.value]; o.value = '<span class="flag ' + cls + '"></span> <span class="country">' + o.value + '</span>'; return o; }, data: { proxy: { url: 'countries.json' } } },{ ...
auto minListWidth
NumberThe minimum width of list for combo column.
When column is not wide but values in list are long than for better look
it is possible to setminListWidth
minListWidth: 150,
minWidth
NumberThe minimum width of column.
minWidth: 80,
multiSelect
BooleanEnables multiSelect for header filter combo.
},{ index: 'country', title: 'Country', type: 'combo', width: 99, filter: { header: true }, displayKey: 'text', valueKey: 'text', multiSelect: true, itemCheckBox: true, minListWidth: 120, data: { proxy: { url: '/json-data/theme/countries.json' } } },{
render
FunctionColumn render function.
Before grid cell will be updated with it's value, function render runs if it exist. Function render is mainly used for some not standard styling or formatting of cell value..
render: function(o){ if(o.value < 0){ o.style = { color: '#E46B67' }; } else{ o.style = { color: '#65AE6E' }; } o.value = o.value + '%'; return o; }
resizable
BooleanEnable resizing of column.
resizable: true,
False rightLocked
BooleanLocking column to right side.
{ type: 'string', width: 65, title: 'Name', index: 'name', rightLocked: true }
False sortable
BooleanEnable column sorting.
sortable: true,
False sorter
FunctionEnable custom column sort.
}, { index: 'age', width: 60, title: 'Age', sorter: function(dir, a, b) { switch (dir) { case 'asc': if (a === '') { return -1; } return a - b; case 'desc': if (b === '') { return -1; } return b - a; } return; }, type: 'number' }, {
undefined title
StringColumn title.
{ type: 'string', width: 65, title: 'Name', index: 'name' }
'' subSearch
BooleanEnables search field in list with values.
This property disableseditable
property.
It is used only for column typecombo
.{ index: 'country', title: 'Country', type: 'combo', subSearch: true, data: { proxy: { url: 'countries.php', method: 'POST', params: { region: 'europe' } } } }
titleEditable
StringEnables column title editing by double click on text.
{ type: 'string', width: 65, title: 'Name', titleEditable: true, index: 'name' }
false type
StringColumn type.
{ index: 'married', title: 'Married', type: 'checkbox' }
valueKey
StringIt is used only for combo. The data value name by which to filter and get/edit data.
columns: [{ ... },{ index: 'state', title: 'State', type: 'combo', width: 110, displayKey: 'text', valueKey: 'value', data: { proxy: { url: 'states.json' } } ... states.json { "data": [{ "value": "", "text": "" },{ "value": "AL", "text": "Alabama" },{ "value": "AK", "text": "Alaska" },{ "value": "AZ", "text": "Arizona" ...
width
Numbercolumn width.
{ type: 'action', width: 65, items: [{ text: 'Delete', cls: 'action-column-remove', action: 'remove' }] }