Skip to content

Commit a49d8ee

Browse files
committed
Add some tips
1 parent 3f504fe commit a49d8ee

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ TabularTables.People = new Tabular.Table({
204204
});
205205
```
206206

207-
208207
## Modifying the Selector
209208

210209
If your table requires the selector to be modified before it's published, you can modify it with the `changeSelector` method. This can be useful for modifying what will be returned in a search. It's called only on the server.
@@ -350,6 +349,12 @@ TabularTables.AppFeedback = new Tabular.Table({
350349

351350
Some useful tips
352351

352+
### Get the DataTable instance
353+
354+
```js
355+
var dt = $(theTableElement).DataTable();
356+
```
357+
353358
### Detect row clicks and get row data
354359

355360
```js
@@ -361,6 +366,14 @@ Template.myTemplate.events({
361366
});
362367
```
363368

369+
### Search in one column
370+
371+
```js
372+
var dt = $(theTableElement).DataTable();
373+
var indexOfColumnToSearch = 0;
374+
dt.column(indexOfColumnToSearch).search('search terms').draw();
375+
```
376+
364377
### Adjust column widths
365378

366379
By default, the DataTables library uses automatic column width calculations. If this makes some of your columns look squished, try setting the `autoWidth: false` option.

0 commit comments

Comments
 (0)