|
Name |
Type |
altRows
|
bool
|
Sets or gets whether the jqxTreeGrid automatically alternates row colors.
|
autoRowHeight
|
bool
|
Sets or gets whether the jqxTreeGrid automatically calculates the rows height and wraps the cell text.
|
aggregatesHeight
|
double
|
Sets or gets the height of the aggregates bar. Aggregates bar is displayed after setting showAggregates to true.
|
autoShowLoadElement
|
bool
|
Sets or gets whether the loading html element with animated gif is automatically displayed by the widget during the data binding process.
|
checkboxes
|
bool
|
Determines whether checkboxes are displayed or not.
|
columnsHeight
|
double
|
Sets or gets the height of the columns header.
|
columns
|
object[]
|
Sets the jqxTreeGrid's columns.
- text - string property which sets the column header's text.
- dataField - string property which sets the column's bound field. It should be unique and should point to a data field defined in the jqxDataAdapter's dataFields array.
- displayField - string property which sets the column's display field. It should be unique and should point to a data field defined in the jqxDataAdapter's dataFields array.
- sortable - boolean property which determines whether the column is sortable.
- filterable - boolean property which determines whether the column is filterable.
- hidden - boolean property which determines whether the column is visible or hidden.
- columnGroup - string property which determines the name of the column's parent group. It should point to a valid name defined in the
columnGroups .
- autoCellHeight - boolean property which determines whether the cell's data wrapping is enabled. This property is set to
true by default. When autoRowHeight is enabled and autoCellHeight is set to false, the cell's data will not be wrapped.
- renderer - callback function for custom rendering of the column's header.
- rendered - callback function which is called after the column's header rendering is completed.
- cellsRenderer - callback function which is called when a cell is being rendered. The result of that function should be valid and well-formatted HTML string. The cellsRenderer function has 4 parameters passed by jqxTreeGrid - row's key, column's data field, cell's value, row's data as an object of Key/Value pairs.
- columnType - string property which determines the column's type.
Possible values:
- "template" - sets a custom editor as a default editor for the column. The editor should be created in the
createEditor callback function. The editor should be synchronized with the cell's value in the initEditor callback. The editor's value should be retrieved in the getEditorValue callback function.
- "custom" - sets a custom editor as a default editor for a cell. That setting enables you to have different cell editors in the column. The editors should be created in the
createEditor callback function which is called for each row when the columnType property is set to "custom". The editors should be synchronized with the cell's value in the initEditor callback. The editor's value should be retrieved in the getEditorValue callback function.
- validation - callback function which is called when the jqxTreeGrid's edited row needs to be validated. The function has 2 parameters - edit cell and the cell's value. The function should return true or false, depending on the user's validation logic. It can also return a validation object with 2 fields - "result" - true or false, and "message" - validation string displayed to the users.
- initEditor - callback function which is called when an editor is opened. It has 5 parameters - row's key, cell's value, the editor element, cell's width and cell's height. The function can be used for adding some custom parameters to the editor.
- createEditor - callback function which is called just once when the cells editor is created. It has 5 parameters - row's key, cell's value, the editor element, cell's width and cell's height. The function can be used for adding some custom parameters to the editor.
- getEditorValue - callback function which could be used for overriding the value returned by the editor. It is useful for advanced scenarios with custom editors. It has 3 parameters - row's key, cell's value and the editor element. The result of the function is expected to be the editor's new value.
- cellsFormat - determines the Format string used for formatting the cell values.
Possible number strings: "d" - decimal numbers. "f" - floating-point numbers. "n" - integer numbers. "c" - currency numbers. "p" - percentage numbers.
For adding decimal places to the numbers, add a number after the formatting string. For example: "c3" displays a number in this format $25.256 Possible built-in Date formats:
// short date pattern d: "M/d/yyyy", // long date pattern D: "dddd, MMMM dd, yyyy", // short time pattern t: "h:mm tt", // long time pattern T: "h:mm:ss tt", // long date, short time pattern f: "dddd, MMMM dd, yyyy h:mm tt", // long date, long time pattern F: "dddd, MMMM dd, yyyy h:mm:ss tt", // month/day pattern M: "MMMM dd", // month/year pattern Y: "yyyy MMMM", // S is a sortable format that does not vary by culture S: "yyyy\u0027-\u0027MM\u0027-\u0027dd\u0027T\u0027HH\u0027:\u0027mm\u0027:\u0027ss"
Possible Date format strings:
"d"-the day of the month; "dd"-the day of the month; "ddd"-the abbreviated name of the day of the week; "dddd"- the full name of the day of the week; "h"-the hour, using a 12-hour clock from 1 to 12; "hh"-the hour, using a 12-hour clock from 01 to 12; "H"-the hour, using a 24-hour clock from 0 to 23; "HH"- the hour, using a 24-hour clock from 00 to 23; "m"-the minute, from 0 through 59; "mm"-the minutes,from 00 though59; "M"- the month, from 1 through 12; "MM"- the month, from 01 through 12; "MMM"-the abbreviated name of the month; "MMMM"-the full name of the month; "s"-the second, from 0 through 59; "ss"-the second, from 00 through 59; "t"- the first character of the AM/PM designator; "tt"-the AM/PM designator; "y"- the year, from 0 to 99; "yy"- the year, from 00 to 99; "yyy"-the year, with a minimum of three digits; "yyyy"-the year as a four-digit number;
- aggregates - array property which determines the column aggregates.
Aggregate functions:
- 'avg' - Average aggregate
- 'count' - Count aggregate
- 'min' - Min aggregate
- 'max' - Max aggregate
- 'sum' - Sum aggregate
- 'product' - Product aggregate
- 'stdev' - Standard deviation on a sample.
- 'stdevp' - Standard deviation on an entire population.
- 'varp' - Variance on an entire population.
- 'var' - Variance on a sample.
Custom Aggregate
aggregates: [{ 'In Stock':
function (aggregatedValue, currentValue) {
if (currentValue) {
return aggregatedValue + 1;
}
return aggregatedValue;
}
}
Custom Aggregate which aggregates values from two columns
{ text: 'Price', dataField: 'price', cellsAlign: 'right', cellsFormat: 'c2', aggregates: [{ 'Total':
function (aggregatedValue, currentValue, column, record) {
var total = currentValue * parseInt(record['quantity']);
return aggregatedValue + total;
}
}]
}
'In Stock' - the aggregate's display name. The function has 2 params - the aggregated value and the current value. It should return an aggregated value.
- aggregatesRenderer - callback function which could be used for customization of the aggregates rendering. It has 1 parameter - the column's aggregates.
- align - string property which determines the alignment of the column's header. Possible values: 'left', 'center' or 'right'
- cellsAlign - string property which determines the alignment of the column's cells. Possible values: 'left', 'center' or 'right'.
- width - numeric property which determines the column's width.
- minWidth - numeric property which determines the column's minimum width. Default value: 25.
- maxWidth - numeric property which determines the column's maximum width.
- resizable - boolean property which determines whether the column is resizable.
- draggable - boolean property which determines whether the column is draggable.
- editable - boolean property which determines whether the column is editable.
- className - string property which sets a custom CSS class for the column's header
- cellClassName - string or function property which sets a custom CSS class for the column's cells. The value could be a "string" or "Function".
- pinned - boolean property which determines whether the column is pinned(frozen).
|
columnGroups
|
object[]
|
Sets the jqxTreeGrid's column groups.
- parentGroup - string property which determines the parent group's name.
- name - string property which determines the group's name.
- align - string property which determines the column header's alignment. Possible values: 'left', 'center' or 'right'.
|
columnsResize
|
bool
|
Sets or gets the jqxTreeGrid's columnsResize.
|
columnsReorder
|
bool
|
Sets or gets the jqxTreeGrid's columnsReorder.
|
disabled
|
bool
|
Sets or gets whether the jqxTreeGrid is disabled.
|
editable
|
bool
|
Sets or gets whether the jqxTreeGrid editing is enabled.
|
editSettings
|
object
|
Sets or gets the jqxTreeGrid's edit settings.
|
exportSettings
|
object
|
Determines the Data Export settings used by jqxTreeGrid when exportData is called. See also the exportData method.
- columnsHeader - boolean value. Determines whether the columns header is exported. Note that Stacked Headers are not exported.
- hiddenColumns - boolean value. Determines whether the hidden columns would be exported.
- serverURL - string or Null. Determines the Exporter File's URL.
- characterSet - string value. Determines the character set used by the exporter.
- collapsedRecords - boolean value. Determines whether the collapsed records would be included in the export.
- recordsInView - boolean value. Determines whether the filtered/sorted set of records would be exported. Otherwise, the widget would not take into account the filtering and sorting.
- fileName - string value. Determines the export file's name.
Code example
var employees = [{ "EmployeeID": 1, "FirstName": "Nancy", "LastName": "Davolio", "ReportsTo": 2, "Country": "USA", "Title": "Sales Representative", "HireDate": "1992-05-01 00:00:00", "BirthDate": "1948-12-08 00:00:00", "City": "Seattle", "Address": "507 - 20th Ave. E.Apt. 2A" }, { "EmployeeID": 2, "FirstName": "Andrew", "LastName": "Fuller", "ReportsTo": null, "Country": "USA", "Title": "Vice President, Sales", "HireDate": "1992-08-14 00:00:00", "BirthDate": "1952-02-19 00:00:00", "City": "Tacoma", "Address": "908 W. Capital Way" }, { "EmployeeID": 3, "FirstName": "Janet", "LastName": "Leverling", "ReportsTo": 2, "Country": "USA", "Title": "Sales Representative", "HireDate": "1992-04-01 00:00:00", "BirthDate": "1963-08-30 00:00:00", "City": "Kirkland", "Address": "722 Moss Bay Blvd." }, { "EmployeeID": 4, "FirstName": "Margaret", "LastName": "Peacock", "ReportsTo": 2, "Country": "USA", "Title": "Sales Representative", "HireDate": "1993-05-03 00:00:00", "BirthDate": "1937-09-19 00:00:00", "City": "Redmond", "Address": "4110 Old Redmond Rd." }, { "EmployeeID": 5, "FirstName": "Steven", "LastName": "Buchanan", "ReportsTo": 2, "Country": "UK", "Title": "Sales Manager", "HireDate": "1993-10-17 00:00:00", "BirthDate": "1955-03-04 00:00:00", "City": "London", "Address": "14 Garrett Hill" }, { "EmployeeID": 6, "FirstName": "Michael", "LastName": "Suyama", "ReportsTo": 5, "Country": "UK", "Title": "Sales Representative", "HireDate": "1993-10-17 00:00:00", "BirthDate": "1963-07-02 00:00:00", "City": "London", "Address": "Coventry House Miner Rd." }, { "EmployeeID": 7, "FirstName": "Robert", "LastName": "King", "ReportsTo": 5, "Country": "UK", "Title": "Sales Representative", "HireDate": "1994-01-02 00:00:00", "BirthDate": "1960-05-29 00:00:00", "City": "London", "Address": "Edgeham Hollow Winchester Way" }, { "EmployeeID": 8, "FirstName": "Laura", "LastName": "Callahan", "ReportsTo": 2, "Country": "USA", "Title": "Inside Sales Coordinator", "HireDate": "1994-03-05 00:00:00", "BirthDate": "1958-01-09 00:00:00", "City": "Seattle", "Address": "4726 - 11th Ave. N.E." }, { "EmployeeID": 9, "FirstName": "Anne", "LastName": "Dodsworth", "ReportsTo": 5, "Country": "UK", "Title": "Sales Representative", "HireDate": "1994-11-15 00:00:00", "BirthDate": "1966-01-27 00:00:00", "City": "London", "Address": "7 Houndstooth Rd." }];
//// prepare the data
var source =
{
dataType: "json",
dataFields: [
{ name: 'EmployeeID', type: 'number' },
{ name: 'ReportsTo', type: 'number' },
{ name: 'FirstName', type: 'string' },
{ name: 'LastName', type: 'string' },
{ name: 'Country', type: 'string' },
{ name: 'City', type: 'string' },
{ name: 'Address', type: 'string' },
{ name: 'Title', type: 'string' },
{ name: 'HireDate', type: 'date' },
{ name: 'BirthDate', type: 'date' }
],
hierarchy:
{
keyDataField: { name: 'EmployeeID' },
parentDataField: { name: 'ReportsTo' }
},
id: 'EmployeeID',
localData: employees
};
var dataAdapter = new $.jqx.dataAdapter(source);
// create Tree Grid
$("#treeGrid").jqxTreeGrid(
{
width: 600,
source: dataAdapter,
ready: function () {
$("#treeGrid").jqxTreeGrid('expandRow', '2');
},
columns: [
{ text: 'First Name', dataField: 'FirstName', width: 150 },
{ text: 'Last Name', dataField: 'LastName', width: 120 },
{ text: 'Title', dataField: 'Title', width: 160 },
{ text: 'Birth Date', dataField: 'BirthDate', cellsFormat: 'd', width: 120 },
{ text: 'Hire Date', dataField: 'HireDate', cellsFormat: 'd', width: 120 },
{ text: 'Address', dataField: 'Address', width: 250 },
{ text: 'City', dataField: 'City', width: 120 },
{ text: 'Country', dataField: 'Country', width: 120 }
]
});
$("#excelExport").jqxButton();
$("#xmlExport").jqxButton();
$("#csvExport").jqxButton();
$("#tsvExport").jqxButton();
$("#htmlExport").jqxButton();
$("#jsonExport").jqxButton();
$("#excelExport").click(function () {
$("#treeGrid").jqxTreeGrid('exportData', 'xls');
});
$("#xmlExport").click(function () {
$("#treeGrid").jqxTreeGrid('exportData', 'xml');
});
$("#csvExport").click(function () {
$("#treeGrid").jqxTreeGrid('exportData', 'csv');
});
$("#tsvExport").click(function () {
$("#treeGrid").jqxTreeGrid('exportData', 'tsv');
});
$("#htmlExport").click(function () {
$("#treeGrid").jqxTreeGrid('exportData', 'html');
});
$("#jsonExport").click(function () {
$("#treeGrid").jqxTreeGrid('exportData', 'json');
});
|
enableHover
|
bool
|
Sets or gets whether row highlighting is enabled.
|
enableBrowserSelection
|
bool
|
Enables or disables the default text selection of the web browser.
|
filterable
|
bool
|
Enables/Disables the filtering feature.
|
filterHeight
|
double
|
Sets or gets the Filter Element's height.
|
filterMode
|
object
|
Determines the Filter's mode. Possible values: "default" , "simple" and "advanced"
|
height
|
object
|
Sets or gets the jqxTreeGrid's height.
|
hierarchicalCheckboxes
|
bool
|
Determines whether changing a checkbox state affects the parent/child records check state. Note: "checkboxes" property value is expected to be true.
|
icons
|
object
|
Determines whether icons are displayed or not.
|
incrementalSearch
|
bool
|
Determines whether the incremental search is enabled. The feature allows you to quickly find and select data records by typing when the widget is on focus.
|
localization
|
object
|
Applies a localization to the jqxTreeGrid's strings.
{ // separator of parts of a date (e.g. '/' in 11/05/1955) '/': "/", // separator of parts of a time (e.g. ':' in 05:44 PM) ':': ":", // the first day of the week (0 = Sunday, 1 = Monday, etc) firstDay: 0, days: { // full day names names: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], // abbreviated day names namesAbbr: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // shortest day names namesShort: [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"] }, months: { // full month names (13 months for lunar calendards -- 13th month should be "" if not lunar) names: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""], // abbreviated month names namesAbbr: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""] }, // AM and PM designators in one of these forms: // The usual view, and the upper and lower case versions // [standard,lowercase,uppercase] // The culture does not use AM or PM (likely all standard date formats use 24 hour time) // null AM: [ "AM", "am", "AM"], PM: [ "PM", "pm", "PM"], eras: [ // eras in reverse chronological order. // name: the name of the era in this culture (e.g. A.D., C.E.) // start: when the era starts in ticks (gregorian, gmt), null if it is the earliest supported era. // offset: offset in years from gregorian calendar { "name": "A.D.", "start": null, "offset": 0 } ], twoDigitYearMax: 2029, patterns: { // short date pattern d: "M/d/yyyy", // long date pattern D: "dddd, MMMM dd, yyyy", // short time pattern t: "h:mm tt", // long time pattern T: "h:mm:ss tt", // long date, short time pattern f: "dddd, MMMM dd, yyyy h:mm tt", // long date, long time pattern F: "dddd, MMMM dd, yyyy h:mm:ss tt", // month/day pattern M: "MMMM dd", // month/year pattern Y: "yyyy MMMM", // S is a sortable format that does not vary by culture S: "yyyy\u0027-\u0027MM\u0027-\u0027dd\u0027T\u0027HH\u0027:\u0027mm\u0027:\u0027ss", // formatting of dates in MySQL DataBases ISO: "yyyy-MM-dd hh:mm:ss", ISO2: "yyyy-MM-dd HH:mm:ss", d1: "dd.MM.yyyy", d2: "dd-MM-yyyy", d3: "dd-MMMM-yyyy", d4: "dd-MM-yy", d5: "H:mm", d6: "HH:mm", d7: "HH:mm tt", d8: "dd/MMMM/yyyy", d9: "MMMM-dd", d10: "MM-dd", d11: "MM-dd-yyyy" }, percentSymbol: "%", currencySymbol: "$", currencySymbolposition: "before", decimalSeparator: '.', thousandsSeparator: ',', pagerGoToPagestring: "Go to page:", pagerShowRowsstring: "Show rows:", pagerRangestring: " of ", pagerPreviousButtonstring: "previous", pagerNextButtonstring: "next", pagerFirstButtonsSring: "first", pagerLastButtonstring: "last", filterApplystring: "Apply", filterCancelstring: "Cancel", filterClearstring: "Clear Filter", filterstring: "advanced", filterSearchstring: "Search:", filterstringComparisonOperators: [ 'empty', 'not empty', 'contains', 'contains(match case)', 'does not contain', 'does not contain(match case)', 'starts with', 'starts with(match case)', 'ends with', 'ends with(match case)', 'equal', 'equal(match case)', 'null', 'not null'], filterNumericComparisonOperators: [ 'equal', 'not equal', 'less than', 'less than or equal', 'greater than', 'greater than or equal', 'null', 'not null'], filterDateComparisonOperators: [ 'equal', 'not equal', 'less than', 'less than or equal', 'greater than', 'greater than or equal', 'null', 'not null'], filterbooleanComparisoOoperators: [ 'equal', 'not equal'], validationstring: "Entered value is not valid", emptyDatastring: "No data to display", filterSelectstring: "Select Filter", loadText: "Loading...", clearstring: "Clear", todaystring: "Today", loadingErrorMessage: "The data is still loading and you cannot set a property or call a method. You can do that once the data binding is completed. jqxTreeGrid raises the 'bindingComplete' event when the binding is completed."
|
pagerHeight
|
double
|
Sets or gets the height of the jqxTreeGrid's Pager(s). Pager(s) is(are) displayed after setting pageable to true.
|
pageSize
|
double
|
Sets or gets the rows count per page when paging is enabled.
|
pageSizeOptions
|
object
|
Sets or gets the jqxTreeGrid's page size options when paging is enabled and the pagerMode property is set to "advanced" .
|
pageable
|
bool
|
Determines whether the jqxTreeGrid is in paging mode.
|
pagerPosition
|
object
|
Sets or gets the Pager's position. Possible values: 'top' , 'bottom' and 'both'
|
pagerMode
|
object
|
Sets or gets the Pager's mode. Possible values: "default" and "advanced"
|
pageSizeMode
|
object
|
Sets or gets the Pager Size's mode. Possible values: "default" and "root"
|
pagerButtonsCount
|
double
|
Sets or gets the count of the buttons displayed on the Pager when pagerMode is set to "default" .
|
pagerRenderer
|
object
|
Enables custom rendering of the Pager.
|
ready
|
object
|
Callback function which is called when the jqxTreeGrid is rendered and data binding is completed..
|
rowDetails
|
bool
|
Sets or gets whether the jqxTreeGrid rows have details. See the rowDetailsRenderer for rendering of the row details.
|
rowDetailsRenderer
|
object
|
Callback function which is used for rendering of the row's details.
- id/key - row's id/key.
- dataRow - the row as a set of Key/Value pairs.
rowDetailsRenderer
|
renderToolbar
|
object
|
Enables custom rendering of the Toolbar.
|
renderStatusBar
|
object
|
Enables custom rendering of the Statusbar.
|
rendering
|
object
|
Callback function which is called before the rendering of the jqxTreeGrid's rows.
|
rendered
|
object
|
Callback function which is called after the rendering of the jqxTreeGrid's row.
|
rtl
|
bool
|
Sets or gets a value indicating whether widget's elements are aligned to support locales using right-to-left fonts.
Code example
Set the rtl property.
$('#treeGrid').jqxTreeGrid({rtl : true});
Get the rtl property.
var rtl = $('#treeGrid').jqxTreeGrid('rtl');
|
source
|
object
|
Determines the jqxTreeGrid's data source. The source property is expected to point to an instance of jqxDataAdapter. For more information about jqxDataAdapter, visit: jquery-data-adapter.htm. To clear the data source, set the source property to null.
|
sortable
|
bool
|
Enables/Disables the sorting feature.
|
showAggregates
|
bool
|
Determines whether the jqxTreeGrid's Aggregates bar is visible.
|
showSubAggregates
|
bool
|
Determines whether jqxTreeGrid would calculate summary values for all values within a group of records and would display the result inside footer cell after each group.
|
showToolbar
|
bool
|
Determines whether the jqxTreeGrid's Toolbar is visible.
|
showStatusbar
|
bool
|
Determines whether the jqxTreeGrid's Statusbar is visible.
|
statusBarHeight
|
double
|
Sets or gets the height of the Statusbar. Statusbar is displayed after setting showStatusbar to true.
|
scrollBarSize
|
double
|
Sets or gets the size of the scrollbars.
|
selectionMode
|
object
|
Sets or gets the selection mode. Possible values: "multipleRows" , "singleRow" and "custom" . In the "custom" mode, rows could be selected/unselected only through the API.
|
showHeader
|
bool
|
Sets or gets the jqxTreeGrid's columns visibility.
|
theme
|
string
|
|
toolbarHeight
|
double
|
Sets or gets the height of the Toolbar. Toolbar is displayed after setting showToolbar to true.
|
width
|
object
|
Sets or gets the jqxTreeGrid's width.
|
virtualModeCreateRecords
|
object
|
By defining that function you can load data into jqxTreeGrid dynamically. For each record only when required, jqxTreeGrid calls virtualModeCreateRecords function and this allows you to provide records on demand. In order to enable the load on demand feature, you should also define the virtualModeRecordCreating function.
- Row Key/ID - unique ID. If null is passed, that the function's result would be the records of the first hierarchy level.
- Done - callback function. Call it when data is loaded and pass the loaded data as an Array.
|
virtualModeRecordCreating
|
object
|
By defining that function you can initialize the dynamic data that you load into jqxTreeGrid. In order to enable the load on demand feature, you should also define virtualModeCreateRecords function.
- Row - object with the following reserved members:
- checked - boolean value. Determines the row's checked state.
- expanded - boolean value. Determines the row's expanded state.
- icon - string value. Determines the row's icon url.
- leaf - boolean value. Determines whether the row is a leaf in the hierarchy. When you set
leaf to true, the expand/collapse button would not be displayed.
- level - Integer value. Returns the row's hierarchy level.
- selected - boolean value. Determines the row's selected state.
|
|
onBindingComplete
|
Event
|
This event is triggered when the jqxTreeGrid binding is completed. *Bind to that event before the jqxTreeGrid's initialization. Otherwise, if you are populating the widget from a local data source and bind to bindingComplete after the initialization, the event could be already raised when you attach an event handler to it.
|
onCellBeginEdit
|
Event
|
This is triggered when a cell edit begins. Note: To turn on cell editing, you should set the editSettings property and make sure that its editSingleCell sub property is set to true .
|
onCellEndEdit
|
Event
|
This is triggered when a cell edit ends. Note: To turn on cell editing, you should set the editSettings property and make sure that its editSingleCell sub property is set to true .
|
onCellValueChanged
|
Event
|
This event is triggered when a cell value is changed.
|
onColumnResized
|
Event
|
This event is triggered when a column is resized.
|
onColumnReordered
|
Event
|
This event is triggered when the column's order is changed.
|
onFilter
|
Event
|
This event is triggered when the jqxTreeGrid's rows filter is changed.
|
onPageChanged
|
Event
|
This is triggered when the jqxTreeGrid's current page is changed.
|
onPageSizeChanged
|
Event
|
This is triggered when the jqxTreeGrid's page size is changed.
|
onRowClick
|
Event
|
This is triggered when a row is clicked.
|
onRowDoubleClick
|
Event
|
This is triggered when a row is double-clicked.
|
onRowSelect
|
Event
|
This is triggered when a row is selected.
|
onRowUnselect
|
Event
|
This is triggered when a row is unselected.
|
onRowBeginEdit
|
Event
|
This is triggered when a row edit begins.
|
onRowEndEdit
|
Event
|
This is triggered when a row edit ends.
|
onRowExpand
|
Event
|
This is triggered when a row is expanded.
|
onRowCollapse
|
Event
|
This is triggered when a row is collapsed.
|
onRowCheck
|
Event
|
This is triggered when a row is checked.
|
onRowUncheck
|
Event
|
This is triggered when a row is unchecked.
|
onSort
|
Event
|
This event is triggered when the jqxTreeGrid sort order or sort column is changed.
|
|
Name |
Arguments |
Return Type |
addRow
|
(object rowKey, object rowData, string rowPosition, string parent)
|
void
|
Adds a new row. For synchronization with a server, please look also the jqxDataAdapter plug-in's help documentation.
- Row Key/ID - unique ID which identifies the row. If null is passed, the jqxTreeGrid will generate an unique.
- Row Data - object with Key/Value pairs. To add an empty row, pass {}.
- Row Position - string with two possible values - "last" and "first". By default "last" is used.
Code example
Invoke the addRow method.
$("#treeGrid").jqxTreeGrid('addRow', null, {});
|
addFilter
|
(string dataField, object filerGroup)
|
void
|
|
applyFilters
|
()
|
void
|
Applies the added/removed filters.
Code example
Invoke the applyFilters method.
$("#treeGrid").jqxTreeGrid('applyFilters');
|
beginUpdate
|
()
|
void
|
Begins an update and stops all refreshes.
Code example
Invoke the beginUpdate method.
$("#treeGrid").jqxTreeGrid('beginUpdate');
|
beginRowEdit
|
(object rowKey)
|
void
|
Begins a row edit operation when editable is set to true.
Code example
Invoke the beginRowEdit method.
$("#treeGrid").jqxTreeGrid('beginRowEdit', 'ALFKI');
|
beginCellEdit
|
(object rowKey, string dataField)
|
void
|
Begins a cell edit operation when editable is set to true.
Code example
Invoke the beginCellEdit method.
$("#treeGrid").jqxTreeGrid('beginCellEdit', 'ALFKI', 'FirstName');
|
clearSelection
|
()
|
void
|
Clears the selection.
Code example
Invoke the clearSelection method.
$("#treeGrid").jqxTreeGrid('clearSelection');
|
clearFilters
|
()
|
void
|
Clears the filters.
Code example
Invoke the clearFilters method.
$("#treeGrid").jqxTreeGrid('clearFilters');
|
clear
|
()
|
void
|
Clears the jqxTreeGrid.
Code example
Invoke the clear method.
$("#treeGrid").jqxTreeGrid('clear');
|
checkRow
|
(object rowKey)
|
void
|
Checks a row when checkboxes is set to true.
Code example
Invoke the checkRow method.
$("#treeGrid").jqxTreeGrid('checkRow', 'ALFKI');
|
collapseRow
|
(object rowKey)
|
void
|
Collapses a row.
Code example
Invoke the collapseRow method.
$("#treeGrid").jqxTreeGrid('collapseRow', 'ALFKI');
|
collapseAll
|
()
|
void
|
Collapses all rows.
Code example
Invoke the collapseAll method.
$("#treeGrid").jqxTreeGrid('collapseAll');
|
destroy
|
()
|
void
|
Destroys jqxTreeGrid and removes it from the DOM.
Code example
Invoke the destroy method.
$("#treeGrid").jqxTreeGrid('destroy');
|
deleteRow
|
(object rowKey)
|
void
|
Deletes a row. For synchronization with a server, please look also the jqxDataAdapter plug-in's help documentation.
Code example
Invoke the deleteRow method.
$("#treeGrid").jqxTreeGrid('deleteRow', 'ALFKI');
|
expandRow
|
(object rowKey)
|
void
|
Expands a row.
Code example
Invoke the expandRow method.
$("#treeGrid").jqxTreeGrid('expandRow', 'ALFKI');
|
expandAll
|
()
|
void
|
Expands all rows.
Code example
Invoke the expandAll method.
$("#treeGrid").jqxTreeGrid('expandAll');
|
endUpdate
|
()
|
void
|
Ends the update and resumes all refreshes.
Code example
Invoke the endUpdate method.
$("#treeGrid").jqxTreeGrid('endUpdate');
|
ensureRowVisible
|
(object rowKey)
|
void
|
Moves the vertical scrollbar to a row.
Code example
Invoke the ensureRowVisible method.
$("#treeGrid").jqxTreeGrid('ensureRowVisible', 'ALFKI');
|
endRowEdit
|
(object rowKey, bool cancelChanges)
|
void
|
Ends a row edit when editable is set to true.
Code example
Invoke the endRowEdit method.
$("#treeGrid").jqxTreeGrid('endRowEdit', 'ALFKI');
Invoke the endRowEdit method and cancel changes.
$("#treeGrid").jqxTreeGrid('endRowEdit', 'ALFKI', true);
|
endCellEdit
|
(object rowKey, string dataField, bool cancelChanges)
|
void
|
Ends a cell edit operation when editable is set to true.
Code example
Invoke the endCellEdit method.
$("#treeGrid").jqxTreeGrid('endCellEdit', 'ALFKI', 'FirstName');
|
exportData
|
(object exportDataType)
|
object
|
Exports TreeGrid Data to Excel, HTML, XML, JSON, CSV or TSV. See also the exportSettings property
Code example
var employees = [{ "EmployeeID": 1, "FirstName": "Nancy", "LastName": "Davolio", "ReportsTo": 2, "Country": "USA", "Title": "Sales Representative", "HireDate": "1992-05-01 00:00:00", "BirthDate": "1948-12-08 00:00:00", "City": "Seattle", "Address": "507 - 20th Ave. E.Apt. 2A" }, { "EmployeeID": 2, "FirstName": "Andrew", "LastName": "Fuller", "ReportsTo": null, "Country": "USA", "Title": "Vice President, Sales", "HireDate": "1992-08-14 00:00:00", "BirthDate": "1952-02-19 00:00:00", "City": "Tacoma", "Address": "908 W. Capital Way" }, { "EmployeeID": 3, "FirstName": "Janet", "LastName": "Leverling", "ReportsTo": 2, "Country": "USA", "Title": "Sales Representative", "HireDate": "1992-04-01 00:00:00", "BirthDate": "1963-08-30 00:00:00", "City": "Kirkland", "Address": "722 Moss Bay Blvd." }, { "EmployeeID": 4, "FirstName": "Margaret", "LastName": "Peacock", "ReportsTo": 2, "Country": "USA", "Title": "Sales Representative", "HireDate": "1993-05-03 00:00:00", "BirthDate": "1937-09-19 00:00:00", "City": "Redmond", "Address": "4110 Old Redmond Rd." }, { "EmployeeID": 5, "FirstName": "Steven", "LastName": "Buchanan", "ReportsTo": 2, "Country": "UK", "Title": "Sales Manager", "HireDate": "1993-10-17 00:00:00", "BirthDate": "1955-03-04 00:00:00", "City": "London", "Address": "14 Garrett Hill" }, { "EmployeeID": 6, "FirstName": "Michael", "LastName": "Suyama", "ReportsTo": 5, "Country": "UK", "Title": "Sales Representative", "HireDate": "1993-10-17 00:00:00", "BirthDate": "1963-07-02 00:00:00", "City": "London", "Address": "Coventry House Miner Rd." }, { "EmployeeID": 7, "FirstName": "Robert", "LastName": "King", "ReportsTo": 5, "Country": "UK", "Title": "Sales Representative", "HireDate": "1994-01-02 00:00:00", "BirthDate": "1960-05-29 00:00:00", "City": "London", "Address": "Edgeham Hollow Winchester Way" }, { "EmployeeID": 8, "FirstName": "Laura", "LastName": "Callahan", "ReportsTo": 2, "Country": "USA", "Title": "Inside Sales Coordinator", "HireDate": "1994-03-05 00:00:00", "BirthDate": "1958-01-09 00:00:00", "City": "Seattle", "Address": "4726 - 11th Ave. N.E." }, { "EmployeeID": 9, "FirstName": "Anne", "LastName": "Dodsworth", "ReportsTo": 5, "Country": "UK", "Title": "Sales Representative", "HireDate": "1994-11-15 00:00:00", "BirthDate": "1966-01-27 00:00:00", "City": "London", "Address": "7 Houndstooth Rd." }];
//// prepare the data
var source =
{
dataType: "json",
dataFields: [
{ name: 'EmployeeID', type: 'number' },
{ name: 'ReportsTo', type: 'number' },
{ name: 'FirstName', type: 'string' },
{ name: 'LastName', type: 'string' },
{ name: 'Country', type: 'string' },
{ name: 'City', type: 'string' },
{ name: 'Address', type: 'string' },
{ name: 'Title', type: 'string' },
{ name: 'HireDate', type: 'date' },
{ name: 'BirthDate', type: 'date' }
],
hierarchy:
{
keyDataField: { name: 'EmployeeID' },
parentDataField: { name: 'ReportsTo' }
},
id: 'EmployeeID',
localData: employees
};
var dataAdapter = new $.jqx.dataAdapter(source);
// create Tree Grid
$("#treeGrid").jqxTreeGrid(
{
width: 600,
source: dataAdapter,
ready: function () {
$("#treeGrid").jqxTreeGrid('expandRow', '2');
},
columns: [
{ text: 'First Name', dataField: 'FirstName', width: 150 },
{ text: 'Last Name', dataField: 'LastName', width: 120 },
{ text: 'Title', dataField: 'Title', width: 160 },
{ text: 'Birth Date', dataField: 'BirthDate', cellsFormat: 'd', width: 120 },
{ text: 'Hire Date', dataField: 'HireDate', cellsFormat: 'd', width: 120 },
{ text: 'Address', dataField: 'Address', width: 250 },
{ text: 'City', dataField: 'City', width: 120 },
{ text: 'Country', dataField: 'Country', width: 120 }
]
});
$("#excelExport").jqxButton();
$("#xmlExport").jqxButton();
$("#csvExport").jqxButton();
$("#tsvExport").jqxButton();
$("#htmlExport").jqxButton();
$("#jsonExport").jqxButton();
$("#excelExport").click(function () {
$("#treeGrid").jqxTreeGrid('exportData', 'xls');
});
$("#xmlExport").click(function () {
$("#treeGrid").jqxTreeGrid('exportData', 'xml');
});
$("#csvExport").click(function () {
$("#treeGrid").jqxTreeGrid('exportData', 'csv');
});
$("#tsvExport").click(function () {
$("#treeGrid").jqxTreeGrid('exportData', 'tsv');
});
$("#htmlExport").click(function () {
$("#treeGrid").jqxTreeGrid('exportData', 'html');
});
$("#jsonExport").click(function () {
$("#treeGrid").jqxTreeGrid('exportData', 'json');
});
|
focus
|
()
|
void
|
Focus jqxTreeGrid.
Code example
Invoke the focus method.
$("#treeGrid").jqxTreeGrid('focus');
|
getColumnProperty
|
(string dataField, string propertyName)
|
object
|
Gets a property value of a column.
Code example
Invoke the getColumnProperty method.
$("#treeGrid").jqxTreeGrid('getColumnProperty', 'firstName', 'width');
|
goToPage
|
(double pageIndex)
|
void
|
Navigates to a page when pageable is set to true.
Code example
Invoke the goToPage method.
$("#treeGrid").jqxTreeGrid('goToPage', 2);
|
goToPrevPage
|
()
|
void
|
Navigates to a previous page when pageable is set to true.
Code example
Invoke the goToPrevPage method.
$("#treeGrid").jqxTreeGrid('goToPrevPage');
|
goToNextPage
|
()
|
void
|
Navigates to a next page when pageable is set to true.
Code example
Invoke the goToNextPage method.
$("#treeGrid").jqxTreeGrid('goToNextPage');
|
getSelection
|
()
|
object[]
|
Returns an array of selected rows.
Code example
Invoke the getSelection method.
$("#treeGrid").jqxTreeGrid('getSelection');
Invoke the getSelection and loop through the selected rows
var selection = $("#table").jqxTreeGrid('getSelection');
for (var i = 0; i < selection.length; i++) {
// get a selected row.
var rowData = selection[i];
}
|
getKey
|
(object row)
|
string
|
Returns the Row's Key. If the row's key is not found, returns null.
Code example
Invoke the getKey method.
var key = $("#table").jqxTreeGrid('getKey', row);
|
getRow
|
(object rowKey)
|
object
|
Returns an object. If the row is not found, returns null.
- checked - boolean value. Returns the row's checked state.
- expanded - boolean value. Returns the row's expanded state.
- icon - string value. Returns the row's icon url.
- leaf - boolean value. Returns whether the row is a leaf in the hierarchy.
- level - Integer value. Returns the row's hierarchy level.
- parent - object. Returns null for root rows. Otherwise, returns the parent row's object
- records - Array. Returns the row's sub-rows collection.
- selected - boolean value. Returns the row's selected state.
- uid - number/string value. Returns the row's unique ID/Key.
Code example
Invoke the getRow method.
var row = $("#table").jqxTreeGrid('getRow', "1.2");
|
getRows
|
()
|
object
|
Returns an array of all rows loaded into jqxTreeGrid.
- checked - boolean value. Returns the row's checked state.
- expanded - boolean value. Returns the row's expanded state.
- icon - string value. Returns the row's icon url.
- leaf - boolean value. Returns whether the row is a leaf in the hierarchy.
- level - Integer value. Returns the row's hierarchy level.
- parent - object. Returns null for root rows. Otherwise, returns the parent row's object
- records - Array. Returns the row's sub-rows collection.
- selected - boolean value. Returns the row's selected state.
- uid - number/string value. Returns the row's unique ID/Key.
Code example
Invoke the getRows method.
$("#treeGrid").jqxTreeGrid('getRows');
Invoke the getRows and loop through the rows
var firstLevelRows = $("#treeGrid").jqxTreeGrid('getRows');
for (var i = 0; i < firstLevelRows.length; i++) {
// get a row.
var rowData = firstLevelRows[i];
}
|
getCheckedRows
|
()
|
object
|
Returns a flat array of all checked rows.
- checked - boolean value. Returns the row's checked state.
- expanded - boolean value. Returns the row's expanded state.
- icon - string value. Returns the row's icon url.
- leaf - boolean value. Returns whether the row is a leaf in the hierarchy.
- level - Integer value. Returns the row's hierarchy level.
- parent - object. Returns null for root rows. Otherwise, returns the parent row's object
- records - Array. Returns the row's sub-rows collection.
- selected - boolean value. Returns the row's selected state.
- uid - number/string value. Returns the row's unique ID/Key.
Code example
Invoke the getCheckedRows method.
$("#treeGrid").jqxTreeGrid('getCheckedRows');
Invoke the getCheckedRows and loop through the rows
var checkedRows = $("#treeGrid").jqxTreeGrid('getCheckedRows');
for (var i = 0; i < checkedRows.length; i++) {
// get a row.
var rowData = checkedRows[i];
}
|
getView
|
()
|
object
|
Returns an array of all rows loaded into jqxTreeGrid. The method takes into account the applied Filtering and Sorting.
- checked - boolean value. Returns the row's checked state.
- expanded - boolean value. Returns the row's expanded state.
- icon - string value. Returns the row's icon url.
- leaf - boolean value. Returns whether the row is a leaf in the hierarchy.
- level - Integer value. Returns the row's hierarchy level.
- parent - object. Returns null for root rows. Otherwise, returns the parent row's object
- records - Array. Returns the row's sub-rows collection.
- selected - boolean value. Returns the row's selected state.
- uid - number/string value. Returns the row's unique ID/Key.
Code example
Invoke the getView method.
$("#treeGrid").jqxTreeGrid('getView');
Invoke the getView and loop through the rows
var firstLevelRows = $("#table").jqxTreeGrid('getView');
for (var i = 0; i < rows.length; i++) {
// get a row.
var rowData = rows[i];
}
|
getCellValue
|
(object rowKey, string dataField)
|
object
|
Returns a value of a cell.
Code example
Invoke the getCellValue method.
var value = $("#treeGrid").jqxTreeGrid('getCellValue', 0, 'firstName');
|
hideColumn
|
(string dataField)
|
void
|
Hides a column.
- data field - column's data field.
Code example
Invoke the hideColumn method.
$("#treeGrid").jqxTreeGrid('hideColumn','firstName');
|
isBindingCompleted
|
()
|
bool
|
Returns whether the binding is completed and if the result is true, this means that you can invoke methods and set properties. Otherwise, if the binding is not completed and you try to set a property or invoke a method, the widget will throw an exception.
Code example
Invoke the isBindingCompleted method.
var isCompleted = $("#grid").jqxTreeGrid('isBindingCompleted');
|
lockRow
|
(object rowKey)
|
void
|
Locks a row i.e editing of the row would be disabled.
Code example
Invoke the lockRow method.
$("#treeGrid").jqxTreeGrid('lockRow', 'ALFKI');
|
refresh
|
()
|
void
|
Performs a layout and updates the HTML elements position and size.
Code example
Invoke the refresh method.
$("#treeGrid").jqxTreeGrid('refresh');
|
render
|
()
|
void
|
Renders jqxTreeGrid.
Code example
Invoke the render method.
$("#treeGrid").jqxTreeGrid('render');
|
removeFilter
|
(string dataField)
|
void
|
Removes a filter.
- data field - column's data field.
Code example
Invoke the removeFilter method.
$("#treeGrid").jqxTreeGrid('removeFilter','firstName');
|
scrollOffset
|
(double top, double left)
|
object
|
Scrolls to a position or gets the scroll position.
Code example
Invoke the scrollOffset method.
$("#treeGrid").jqxTreeGrid('scrollOffset', 10, 10);
Get the scroll position.
var offset = $("#treeGrid").jqxTreeGrid('scrollOffset');
var left = offset.left;
var top = offset.top;
|
setColumnProperty
|
(string dataField, string propertyName, object propertyValue)
|
void
|
Sets a property of a column. See the columns property for more information.
Code example
Invoke the setColumnProperty method.
$("#treeGrid").jqxTreeGrid('setColumnProperty', 'firstName', 'width', 200);
|
showColumn
|
(string dataField)
|
void
|
Shows a column.
Code example
Invoke the showColumn method.
$("#treeGrid").jqxTreeGrid('showColumn', 'firstName');
|
selectRow
|
(object rowId)
|
void
|
Selects a row.
Code example
Invoke the selectRow method.
$("#treeGrid").jqxTreeGrid('selectRow', 'ALFKI');
|
setCellValue
|
(string rowId, string dataField, object cellValue)
|
void
|
Sets a value of a cell.
Code example
Invoke the setCellValue method.
$("#treeGrid").jqxTreeGrid('setCellValue', 'ALFKI', 'firstName', 'New Value');
|
sortBy
|
(object dataField, object sortOrder)
|
void
|
Sorts a column, if sortable is set to true.
Code example
Invoke the sortBy method.
$("#treeGrid").jqxTreeGrid('sortBy', 'firstName', 'asc');
|
updating
|
()
|
bool
|
Gets a boolean value which determines whether jqxTreeGrid is in update state i.e the beginUpdate method was called and the endUpdate method is not called yet.
Code example
Invoke the updating method.
var isUpdating = $("#treeGrid").jqxTreeGrid('updating');
|
updateBoundData
|
()
|
void
|
Performs a data bind and updates jqxTreeGrid with the new data.
Code example
Invoke the updateBoundData method.
$("#treeGrid").jqxTreeGrid('updateBoundData');
|
unselectRow
|
(object rowId)
|
void
|
Unselects a row.
Code example
Invoke the unselectRow method.
$("#treeGrid").jqxTreeGrid('unselectRow', 'ALFKI');
|
uncheckRow
|
(string rowId)
|
void
|
Unchecks a row when checkboxes is set to true.
Code example
Invoke the uncheckRow method.
$("#treeGrid").jqxTreeGrid('uncheckRow', 'ALFKI');
|
updateRow
|
(object rowId, object data)
|
void
|
Updates the row's data. For synchronization with a server, please look also the jqxDataAdapter plug-in's help documentation.
Code example
Invoke the updateRow method.
$("#treeGrid").jqxTreeGrid('updateRow', 'ALFKI', {firstName: "New First Name", lastName: "New Last Name"});
|
unlockRow
|
(object rowId)
|
void
|
Unlocks a row.
Code example
Invoke the unlockRow method.
$("#treeGrid").jqxTreeGrid('unlockRow', 'ALFKI');
|