Documentation
API Summary
Initial Parameters
caption
Type: String or Function
Default: null
The text as table caption. You can define a callback function for generating customized caption instead. Set null to disable caption generation.
Example:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
captionTooltip
Type: String or Object
Default: null
The tooltip text for caption, which will make use of jQuery UI tooltip. You can pass an object as the initial parameters of jQuery UI tooltip, too.
Example:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
initRows
Type: Number
Default: 3
The total number of empty rows generated when init the grid. This will be ignored if initData is assigned.
maxRowsAllowed
Type: Number
Default: 0
The maximum number of rows allowed in this grid. Default value is 0 which means unlimited. The maxNumRowsReached callback function will be triggered when row(s) is/are adding to grid after maximum number of row reached.
initData
Type: Array
Default: null
An array of data to be filled after initialized the grid.
Example:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
columns
Type: Array
Default: null
Array of column options. Please refer to Column Parameters for more.
Example:
|
1 2 3 4 5 6 7 8 9 |
|
i18n
Type: Object
Default: null
Labels or messages used in grid.
| append: | The tooltip on the `append` button at the bottom of grid. | |
| removeLast: | The tooltip on the `remove` button at the bottom of grid. | |
| insert: | The tooltip on the `insert` button at the end on each row. | |
| remove: | The tooltip on the `remove` button at the end on each row. | |
| moveUp: | The tooltip on the `move up` button at the end on each row. | |
| moveDown: | The tooltip on the `move down` button at the end on each row. | |
| rowDrag: | The tooltip on the `drag` button at the end on each row, if rowDragging is set to true. | |
| rowEmpty: | The message to be displayed when no rows in grid. |
Example:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
idPrefix
Type: String
Default: null
The ID prefix of controls generated inside the grid. Table ID will be used if not defined.
Example:
|
1 2 3 4 5 6 7 8 9 10 11 |
|
rowDragging
Type: Boolean
Default: false
Applying jQuery UI Sortable feature to allow re-order grid rows by dragging.
hideButtons
Type: Object
Default: null
Hide the standard action buttons at the end of row or bottom of grid.
| append: | Set to true to hide the `append` button at the bottom or grid. | |
| removeLast: | Set to true to hide the `remove` button at the bottom of grid. | |
| insert: | Set to true to hide the `insert` button at the end on each row. | |
| remove: | Set to true to hide the `remove` button at the end on each row. | |
| moveUp: | TheSet to true to hide the `move up` button at the end on each row. | |
| moveDown: | Set to true to hide the `move down` button at the end on each row. |
Example:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
buttonClasses
Type: Object
Default: null
The extra class names for buttons.
| append: | The extra class name to be added on the `append` button at the bottom of grid. | |
| removeLast: | The extra class name to be added on the `remove` button at the bottom of grid. | |
| insert: | The extra class name to be added on the `insert` button at the end on each row. | |
| remove: | The extra class name to be added on the `remove` button at the end on each row. | |
| moveUp: | The extra class name to be added on the `move up` button at the end on each row. | |
| moveDown: | The extra class name to be added on the `move down` button at the end on each row. | |
| rowDrag: | The extra class name to be added on the `drag` button at the end on each row, if rowDragging is set to true. |
Example:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
sectionClasses
Type: Object
Default: null
The extra class names for table sections.
| caption: | The extra class name to be added on the caption table row. | |
| header: | The extra class name to be added on the column header table row. | |
| body: | The extra class name to be added on each grid content table row. | |
| footer: | The extra class name to be added on the footer table row. |
Example:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
hideRowNumColumn
Type: Boolean
Default: false
Hide the row number column which is the first column of grid.
rowButtonsInFront
Type: Boolean
Default: false
Generate row button column in the front of input columns.
customGridButtons
Type: Object
Default: null
Customize the standard grid button such as changing the icon, adding text to the button or even use another button to replace the default one. You can specify jQuery UI Button initial parameter, a DOM element or a function that create a DOM element for each of the following button.
| append: | The jQuery UI button initial parameter or DOM element or a function that create a DOM element as the `append` button at the bottom of grid. | |
| removeLast: | The jQuery UI button initial parameter or DOM element or a function that create a DOM element as the `remove` button at the bottom of grid. | |
| insert: | The jQuery UI button initial parameter or DOM element or a function that create a DOM element as the `insert` button at the end on each row. | |
| remove: | The jQuery UI button initial parameter or DOM element or a function that create a DOM element as the `remove` button at the end on each row. | |
| moveUp: | The jQuery UI button initial parameter or DOM element or a function that create a DOM element as the `move up` button at the end on each row. | |
| moveDown: | The jQuery UI button initial parameter or DOM element or a function that create a DOM element as the `move down` button at the end on each row. |
Example:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
customRowButtons
Type: Array
Default: null
Add an array of customized buttons to the last cell of each row. The generated buttons are supported all jQuery UI Button widget parameters with a click event handler.
| uiButton: | Required. Object of parameters used to initial jQuery UI Button widget. | |
| click: | Required. A event handler to be called when the generated button is clicked. Followings are the parameters will be sent to this event handler: 1. evtObj: The standard jQuery event object. 2. uniqueIndex: The uniqueIndex of that row. 3. rowData: An object contains the values of all controls of that row. |
|
| btnCss: | The extra CSS to be added on the generated button. | |
| btnClass: | The extra classes to be added on the generated button. | |
| btnAttr: | The extra attributes to be added on the generated button. | |
| atTheFront: | Set to true for generate button at the front of standard action buttons. |
Example:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
customFooterButtons
Type: Array
Default: null
Add an array of customized buttons to the bottom of grid. The generated buttons are supported all jQuery UI Button widget parameters with a click event handler.
| uiButton: | Required. Object of parameters used to initial jQuery UI Button widget. | |
| click: | Required. A event handler to be called when the generated button is clicked. The first parameter of the call back function is the standard jQuery event object. | |
| btnCss: | The extra CSS to be added on the generated button. | |
| btnClass: | The extra classes to be added on the generated button. | |
| btnAttr: | The extra attributes to be added on the generated button. | |
| atTheFront: | Set to true for generate button at the front of standard action buttons. |
Example:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
rowCountName
Type: String
Default: \'_RowCount\'
The variable name of row count used for object mode of `getAllValue` method.
useSubPanel
Type: Boolean
Default: false
Use the sub panel or not.
maintainScroll
Type: Boolean
Default: false
The web browser will maintain the scroll position when add or remove row if this parameter is set to true.
maxBodyHeight
Type: Number
Default: 0
The maximum height of table body. Vertical scrollbar will be displayed when this height limit is reached. Default value is 0 which means this limit will not be applied.
Example:
|
1 2 3 4 5 6 7 8 9 10 11 |
|
Grid Callbacks
nameFormatter(idPrefix, name, uniqueIndex)
Type: Function
The callback function for format the HTML name of generated controls.
| idPrefix: | The idPrefix defined in Initial Parameters. | |
| name: | The name of column. | |
| uniqueIndex: | The unique index assigned to this row. |
Example:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
dataLoaded(caller, records)
Type: Function
The callback function to be triggered after data loaded to grid.
| caller: | The table object that triggered this event. | |
| records: | The array of data that loaded to grid. |
rowDataLoaded(caller, record, rowIndex, uniqueIndex)
Type: Function
The callback function to be triggered after data loaded to a row.
| caller: | The table object that triggered this event. | |
| record: | The data object that loaded to this row. | |
| rowIndex: | Row index of target row. | |
| uniqueIndex: | Unique index of target row. |
afterRowAppended(caller, parentRowIndex, addedRowIndex)
Type: Function
The callback function to be triggered after new row appended.
| caller: | The table object that triggered this event. | |
| parentRowIndex: | The index of row that above new added rows. This value will be null when table is empty. | |
| addedRowIndex: | An array of row index added. |
Example:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
本文仅代表作者观点,不代表百度立场。 |

