corrade-nucleus-nucleons – Blame information for rev 20

Subversion Repositories:
Rev:
Rev Author Line No. Line
20 office 1 # Methods []({{ site.repo }}/blob/develop/docs/_i18n/{{ site.lang }}/documentation/methods.md)
2  
3 ---
4  
5 The calling method syntax: `$('#table').bootstrapTable('method', parameter);`.
6  
7 <table class="table"
8 id="m"
9 data-search="true"
10 data-show-toggle="true"
11 data-show-columns="true"
12 data-mobile-responsive="true">
13 <thead>
14 <tr>
15 <th>Name</th>
16 <th>Parameter</th>
17 <th>Description</th>
18 <th data-formatter="methodFormatter"
19 data-align="center"
20 data-valign="middle">Example</th>
21 </tr>
22 </thead>
23 <tbody>
24 <tr>
25 <td>getOptions</td>
26 <td>none</td>
27 <td>Return the options object.</td>
28 <td>getOptions</td>
29 </tr>
30 <tr>
31 <td>getSelections</td>
32 <td>none</td>
33 <td>Return selected rows, when no record selected, an empty array will return.</td>
34 <td>getSelections</td>
35 </tr>
36 <tr>
37 <td>getAllSelections</td>
38 <td>none</td>
39 <td>Return all selected rows contain search or filter, when no record selected, an empty array will return.</td>
40 <td>getAllSelections</td>
41 </tr>
42 <tr>
43 <td>showAllColumns</td>
44 <td>none</td>
45 <td>Show All the columns.</td>
46 <td>showAllColumns</td>
47 </tr>
48 <tr>
49 <td>hideAllColumns</td>
50 <td>none</td>
51 <td>Hide All the columns.</td>
52 <td>hidAllColumns</td>
53 </tr>
54 <tr>
55 <td>getData</td>
56 <td>useCurrentPage</td>
57 <td>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.</td>
58 <td>getData</td>
59 </tr>
60 <tr>
61 <td>getRowByUniqueId</td>
62 <td>id</td>
63 <td>Get data from table, the row that contains the id passed by parameter.</td>
64 <td>getRowByUniqueId</td>
65 </tr>
66 <tr>
67 <td>load</td>
68 <td>data</td>
69 <td>Load the data to table, the old rows will be removed.</td>
70 <td>load</td>
71 </tr>
72 <tr>
73 <td>append</td>
74 <td>data</td>
75 <td>Append the data to table.</td>
76 <td>append</td>
77 </tr>
78 <tr>
79 <td>prepend</td>
80 <td>data</td>
81 <td>Prepend the data to table.</td>
82 <td>prepend</td>
83 </tr>
84 <tr>
85 <td>remove</td>
86 <td>params</td>
87 <td>
88 Remove data from table, the params contains two properties: <br>
89 field: the field name of remove rows. <br>
90 values: the array of values for rows which should be removed.
91 </td>
92 <td>remove</td>
93 </tr>
94 <tr>
95 <td>removeAll</td>
96 <td>-</td>
97 <td>
98 Remove all data from table.
99 </td>
100 <td>removeAll</td>
101 </tr>
102 <tr>
103 <td>removeByUniqueId</td>
104 <td>id</td>
105 <td>
106 Remove data from table, the row that contains the id passed by parameter.
107 </td>
108 <td>removeByUniqueId</td>
109 </tr>
110 <tr>
111 <td>insertRow</td>
112 <td>params</td>
113 <td>
114 Insert a new row, the param contains following properties:<br>
115 index: the row index to insert into.<br>
116 row: the row data.
117 </td>
118 </tr>
119 <tr>
120 <td>updateRow</td>
121 <td>params</td>
122 <td>
123 Update the specified row(s), each param contains following properties: <br>
124 index: the row index to be updated. <br>
125 row: the new row data.
126 </td>
127 </tr>
128 <tr>
129 <td>updateByUniqueId</td>
130 <td>params</td>
131 <td>
132 Update the specified row(s), each param contains following properties: <br>
133 id: a row id where the id should be the uniqueid field assigned to the table. <br>
134 row: the new row data.
135 </td>
136 </tr>
137 <tr>
138 <td>showRow</td>
139 <td>params</td>
140 <td>Show the specified row. The param must contain at least one of the following properties:
141 index: the row index.
142 uniqueId: the value of the uniqueId for that row.</td>
143 </tr>
144 <tr>
145 <td>hideRow</td>
146 <td>params</td>
147 <td>Hide the specified row. The param must contain at least one of the following properties:
148 index: the row index.
149 uniqueId: the value of the uniqueId for that row.</td>
150 </tr>
151 <tr>
152 <td>getRowsHidden</td>
153 <td>boolean</td>
154 <td>Get all rows hidden and if you pass the show parameter true the rows will be shown again, otherwise, the method
155 only will return the rows hidden.</td>
156 </tr>
157 <tr>
158 <td>mergeCells</td>
159 <td>options</td>
160 <td>
161 Merge some cells to one cell, the options contains following properties: <br>
162 index: the row index. <br>
163 field: the field name.<br>
164 rowspan: the rowspan count to be merged. <br>
165 colspan: the colspan count to be merged.
166 </td>
167 </tr>
168 <tr>
169 <td>updateCell</td>
170 <td>params</td>
171 <td>
172 Update one cell, the params contains following properties: <br>
173 index: the row index. <br>
174 field: the field name.<br>
175 value: the new field value.
176 <br>
177 To disable table re-initialization you can set <code>{reinit: false}</code>
178 </td>
179 </tr>
180 <tr>
181 <td>refresh</td>
182 <td>params</td>
183 <td>Refresh the remote server data, you can set <code>{silent: true}</code> to refresh the data silently, and set <code>{url: newUrl, pageNumber: pageNumber, pageSize: pageSize}</code> to change the url (optional), page number (optional) and page size (optional). To supply query params specific to this request, set <code>{query: {foo: 'bar'}}</code>.</td>
184 </tr>
185 <tr>
186 <td>refreshOptions</td>
187 <td>options</td>
188 <td>Refresh the options</td>
189 </tr>
190 <tr>
191 <td>resetSearch</td>
192 <td>text</td>
193 <td>Set the search text</td>
194 </tr>
195 <tr>
196 <td>showLoading</td>
197 <td>none</td>
198 <td>Show loading status.</td>
199 </tr>
200 <tr>
201 <td>hideLoading</td>
202 <td>none</td>
203 <td>Hide loading status.</td>
204 </tr>
205 <tr>
206 <td>checkAll</td>
207 <td>none</td>
208 <td>Check all current page rows.</td>
209 </tr>
210 <tr>
211 <td>uncheckAll</td>
212 <td>none</td>
213 <td>Uncheck all current page rows.</td>
214 </tr>
215 <tr>
216 <td>checkInvert</td>
217 <td>none</td>
218 <td>Invert check of current page rows. Triggers onCheckSome and onUncheckSome events.</td>
219 </tr>
220 <tr>
221 <td>check</td>
222 <td>index</td>
223 <td>Check a row, the row index start with 0.</td>
224 </tr>
225 <tr>
226 <td>uncheck</td>
227 <td>index</td>
228 <td>Uncheck a row, the row index start with 0.</td>
229 </tr>
230 <tr>
231 <td>checkBy</td>
232 <td>params</td>
233 <td>
234 Check a row by array of values, the params contains:<br>
235 field: name of the field used to find records<br>
236 values: array of values for rows to check<br>
237 Example: <br>
238 $("#table").bootstrapTable("checkBy", {field:"field_name", values:["value1","value2","value3"]})
239 </td>
240 </tr>
241 <tr>
242 <td>uncheckBy</td>
243 <td>params</td>
244 <td>
245 Uncheck a row by array of values, the params contains:<br>
246 field: name of the field used to find records<br>
247 values: array of values for rows to uncheck<br>
248 Example: <br>
249 $("#table").bootstrapTable("uncheckBy", {field:"field_name", values:["value1","value2","value3"]})
250 </td>
251 </tr>
252 <tr>
253 <td>resetView</td>
254 <td>params</td>
255 <td>Reset the bootstrap table view, for example reset the table height.</td>
256 </tr>
257 <tr>
258 <td>resetWidth</td>
259 <td>none</td>
260 <td>Resizes header and footer to fit current columns width</td>
261 </tr>
262 <tr>
263 <td>destroy</td>
264 <td>none</td>
265 <td>Destroy the bootstrap table.</td>
266 </tr>
267 <tr>
268 <td>showColumn</td>
269 <td>field</td>
270 <td>Show the specified column.</td>
271 </tr>
272 <tr>
273 <td>hideColumn</td>
274 <td>field</td>
275 <td>Hide the specified column.</td>
276 </tr>
277 <tr>
278 <td>getHiddenColumns</td>
279 <td>-</td>
280 <td>Get hidden columns.</td>
281 </tr>
282 <tr>
283 <td>getVisibleColumns</td>
284 <td>-</td>
285 <td>Get visible columns.</td>
286 </tr>
287 <tr>
288 <td>scrollTo</td>
289 <td>value</td>
290 <td>Scroll to the number value position, the unit is 'px', set 'bottom' means scroll to the bottom.</td>
291 </tr>
292 <tr>
293 <td>getScrollPosition</td>
294 <td>none</td>
295 <td>Get the current scroll position, the unit is 'px'.</td>
296 </tr>
297 <tr>
298 <td>filterBy</td>
299 <td>params</td>
300 <td>(Can use only in client-side) Filter data in table, e.g. you can filter <code>{age: 10}</code> to show the data only age is equal to 10. You can also filter with an array of values, as in: <code>{age: 10, hairColor: ["blue", "red", "green"]} to find data where age is equal to 10 and hairColor is either blue, red, or green.</td>
301 </tr>
302 <tr>
303 <td>selectPage</td>
304 <td>page</td>
305 <td>Go to the a specified page.</td>
306 </tr>
307 <tr>
308 <td>prevPage</td>
309 <td>none</td>
310 <td>Go to previous page.</td>
311 </tr>
312 <tr>
313 <td>nextPage</td>
314 <td>none</td>
315 <td>Go to next page.</td>
316 </tr>
317 <tr>
318 <td>togglePagination</td>
319 <td>none</td>
320 <td>Toggle the pagination option.</td>
321 </tr>
322 <tr>
323 <td>toggleView</td>
324 <td>none</td>
325 <td>Toggle the card/table view.</td>
326 </tr>
327 <tr>
328 <td>expandRow</td>
329 <td>index</td>
330 <td>Expand the row that has the index passed by parameter if the detail view option is set to True.</td>
331 </tr>
332 <tr>
333 <td>collapseRow</td>
334 <td>index</td>
335 <td>Collapse the row that has the index passed by parameter if the detail view option is set to True.</td>
336 </tr>
337 <tr>
338 <td>expandAllRows</td>
339 <td>is subtable</td>
340 <td>Expand all rows if the detail view option is set to True.</td>
341 </tr>
342 <tr>
343 <td>collapseAllRows</td>
344 <td>is subtable</td>
345 <td>Collapse all rows if the detail view option is set to True.</td>
346 </tr>
347 </tbody>
348 </table>