# Methods []({{ site.repo }}/blob/master/docs/_i18n/{{ site.lang }}/documentation/methods.md) --- The calling method syntax: `$('#table').bootstrapTable('method', parameter);`.
Name Parameter Description Example
getOptions none Return the options object. getOptions
getSelections none Return selected rows, when no record selected, an empty array will return. getSelections
getAllSelections none Return all selected rows contain search or filter, when no record selected, an empty array will return. getAllSelections
showAllColumns none Show All the columns. showAllColumns
hideAllColumns none Hide All the columns. hidAllColumns
getData useCurrentPage Get the loaded data of table at the moment that this method is called. If you set the useCurrentPage to true the method will return the data in the current page. getData
getRowByUniqueId id Get data from table, the row that contains the id passed by parameter. getRowByUniqueId
load data Load the data to table, the old rows will be removed. load
append data Append the data to table. append
prepend data Prepend the data to table. prepend
remove params Remove data from table, the params contains two properties:
field: the field name of remove rows.
values: the array of values for rows which should be removed.
remove
removeAll - Remove all data from table. removeAll
removeByUniqueId id Remove data from table, the row that contains the id passed by parameter. removeByUniqueId
insertRow params Insert a new row, the param contains following properties:
index: the row index to insert into.
row: the row data.
updateRow params Update the specified row(s), each param contains following properties:
index: the row index to be updated.
row: the new row data.
updateByUniqueId params Update the specified row(s), each param contains following properties:
id: a row id where the id should be the uniqueid field assigned to the table.
row: the new row data.
showRow params Show the specified row. The param must contain at least one of the following properties: index: the row index. uniqueId: the value of the uniqueId for that row.
hideRow params Hide the specified row. The param must contain at least one of the following properties: index: the row index. uniqueId: the value of the uniqueId for that row.
getRowsHidden boolean Get all rows hidden and if you pass the show parameter true the rows will be shown again, otherwise, the method only will return the rows hidden.
mergeCells options Merge some cells to one cell, the options contains following properties:
index: the row index.
field: the field name.
rowspan: the rowspan count to be merged.
colspan: the colspan count to be merged.
updateCell params Update one cell, the params contains following properties:
index: the row index.
field: the field name.
value: the new field value.
To disable table re-initialization you can set {reinit: false}
refresh params Refresh the remote server data, you can set {silent: true} to refresh the data silently, and set {url: newUrl} to change the url. To supply query params specific to this request, set {query: {foo: 'bar'}}
refreshOptions options Refresh the options
showLoading none Show loading status.
hideLoading none Hide loading status.
checkAll none Check all current page rows.
uncheckAll none Uncheck all current page rows.
checkInvert none Invert check of current page rows. Triggers onCheckSome and onUncheckSome events.
check index Check a row, the row index start with 0.
uncheck index Uncheck a row, the row index start with 0.
checkBy params Check a row by array of values, the params contains:
field: name of the field used to find records
values: array of values for rows to check
Example:
$("#table").bootstrapTable("checkBy", {field:"field_name", values:["value1","value2","value3"]})
uncheckBy params Uncheck a row by array of values, the params contains:
field: name of the field used to find records
values: array of values for rows to uncheck
Example:
$("#table").bootstrapTable("uncheckBy", {field:"field_name", values:["value1","value2","value3"]})
resetView params Reset the bootstrap table view, for example reset the table height.
resetWidth none Resizes header and footer to fit current columns width
destroy none Destroy the bootstrap table.
showColumn field Show the specified column.
hideColumn field Hide the specified column.
getHiddenColumns - Get hidden columns.
getVisibleColumns - Get visible columns.
scrollTo value Scroll to the number value position, the unit is 'px', set 'bottom' means scroll to the bottom.
getScrollPosition none Get the current scroll position, the unit is 'px'.
filterBy params (Can use only in client-side) Filter data in table, e.g. you can filter {age: 10} to show the data only age is equal to 10. You can also filter with an array of values, as in: {age: 10, hairColor: ["blue", "red", "green"]} to find data where age is equal to 10 and hairColor is either blue, red, or green.
selectPage page Go to the a specified page.
prevPage none Go to previous page.
nextPage none Go to next page.
togglePagination none Toggle the pagination option.
toggleView none Toggle the card/table view.
expandRow index Expand the row that has the index passed by parameter if the detail view option is set to True.
collapseRow index Collapse the row that has the index passed by parameter if the detail view option is set to True.
expandAllRows is subtable Expand all rows if the detail view option is set to True.
collapseAllRows is subtable Collapse all rows if the detail view option is set to True.