# 事件 []({{ site.repo }}/blob/master/docs/_i18n/{{ site.lang }}/documentation/events.md) ---
Option 事件 | jQuery 事件 | 参数 | 描述 |
---|---|---|---|
onAll | all.bs.table | name, args |
所有的事件都会触发该事件,参数包括: name:事件名, args:事件的参数。 |
onClickRow | click-row.bs.table | row, $element |
当用户点击某一行的时候触发,参数包括: row:点击行的数据, $element:tr 元素。 |
onDblClickRow | dbl-click-row.bs.table | row, $element |
当用户双击某一行的时候触发,参数包括: row:点击行的数据, $element:tr 元素。 |
onClickCell | click-cell.bs.table | field, value, row, $element |
当用户点击某一列的时候触发,参数包括: field:点击列的 field 名称, value:点击列的 value 值, row:点击列的整行数据, $element:td 元素。 |
onDblClickCell | dbl-click-cell.bs.table | field, value, row, $element |
当用户双击某一列的时候触发,参数包括: field:点击列的 field 名称, value:点击列的 value 值, row:点击列的整行数据, $element:td 元素。 |
onSort | sort.bs.table | name, order |
Fires when user sort a column, the parameters contains: name: the sort column field name order: the sort column order. |
onCheck | check.bs.table | row |
Fires when user check a row, the parameters contains: row: the record corresponding to the clicked row. $element: the DOM element checked. |
onUncheck | uncheck.bs.table | row |
Fires when user uncheck a row, the parameters contains: row: the record corresponding to the clicked row. $element: the DOM element unchecked. |
onCheckAll | check-all.bs.table | rows |
Fires when user check all rows, the parameters contains: rows: array of records corresponding to newly checked rows. |
onUncheckAll | uncheck-all.bs.table | rows |
Fires when user uncheck all rows, the parameters contains: rows: array of records corresponding to previously checked rows. |
onCheckSome | check-some.bs.table | rows |
Fires when user check some rows, the parameters contains: rows: array of records corresponding to previously checked rows. |
onUncheckSome | uncheck-some.bs.table | rows |
Fires when user uncheck some rows, the parameters contains: rows: array of records corresponding to previously checked rows. |
onLoadSuccess | load-success.bs.table | data | Fires when remote data is loaded successfully. |
onLoadError | load-error.bs.table | status | Fires when some errors occur to load remote data. |
onColumnSwitch | column-switch.bs.table | field, checked | Fires when switch the column visible. |
onColumnSearch | column-search.bs.table | field, text | Fires when search by column. |
onPageChange | page-change.bs.table | number, size | Fires when change the page number or page size. |
onSearch | search.bs.table | text | Fires when search the table. |
onToggle | toggle.bs.table | cardView | Fires when toggle the view of table. |
onPreBody | pre-body.bs.table | data | Fires before the table body is rendered |
onPostBody | post-body.bs.table | none | Fires after the table body is rendered and available in the DOM |
onPostHeader | post-header.bs.table | none | Fires after the table header is rendered and availble in the DOM |
onExpandRow | expand-row.bs.table | index, row, $detail | 当点击详细图标展开详细页面的时候触发。 |
onCollapseRow | collapse-row.bs.table | index, row | 当点击详细图片收起详细页面的时候触发。 |
onRefreshOptions | refresh-options.bs.table | options | Fires after refresh the options and before destroy and init the table |