Skip to content

Commit d5aed3f

Browse files
author
syshex
committed
1.1.5
1 parent ebf002d commit d5aed3f

File tree

9 files changed

+70
-10
lines changed

9 files changed

+70
-10
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
### 1.1.5 (June 21, 2017)
4+
5+
* Row Click Handler added
6+
37
### 1.1.4 (June 12, 2017)
48

59
* Fix- delegate now doesn't use echo

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
vue-bootstrap-table is a sortable and searchable table, with Bootstrap styling, for Vue.js.
44

5-
### VUE 1 : 1.1.4
5+
### VUE 1 : 1.1.5
66

77
### Vue 2 : [jbaysolutions/vue2-bootstrap-table](https://github.com/jbaysolutions/vue2-bootstrap-table)
88

@@ -281,6 +281,36 @@ There must be a javascript function called `renderTestColumn` :
281281
</script>
282282
```
283283

284+
### ROW Click Handler
285+
286+
To add a Row click handler function:
287+
288+
````html
289+
290+
<vue-bootstrap-table
291+
[...]
292+
:row-click-handler=handleRowFunction
293+
>
294+
</vue-bootstrap-table>
295+
````
296+
297+
On your Vue instance :
298+
299+
````javascript
300+
data: {
301+
handleRowFunction: handleRow,
302+
}
303+
````
304+
305+
And have the javascript function declared like so:
306+
307+
````javascript
308+
var handleRow = function (event, entry) {
309+
console.log("CLICK ROW: " + JSON.stringify(entry));
310+
};
311+
````
312+
313+
Where event in the `MouseEvent` and `entry` e the complete entry corresponding to the row.
284314

285315
### AJAX Configuration
286316

@@ -432,6 +462,10 @@ If you have a feature request, please add it as an issue or make a pull request.
432462

433463
## Changelog
434464

465+
### 1.1.5
466+
467+
* Row Click Handler added
468+
435469
### 1.1.4
436470

437471
* Fix- delegate now doesn't use echo

dist/vue-bootstrap-table.js

Lines changed: 11 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-bootstrap-table.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-bootstrap-table.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ <h1>Vue Bootstrap Table</h1>
3636
:paginated="paginated"
3737
:multi-column-sortable="multiColumnSortable"
3838
:ajax="ajax"
39+
:row-click-handler=handleRowFunction
3940
>
4041
</vue-bootstrap-table>
4142
</div>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-bootstrap-table2",
3-
"version": "1.1.4",
3+
"version": "1.1.5",
44
"description": "A sortable and searchable vue table, as a Vue component, using bootstrap styling.",
55
"keywords": [
66
"table",

src/VueBootstrapTable.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
</tr>
4646
</thead>
4747
<tbody>
48-
<tr v-for="entry in filteredValuesSorted " track-by="$index">
48+
<tr v-for="entry in filteredValuesSorted " track-by="$index" @click="rowClickHandler($event, entry)">
4949
<td v-for="column in displayColsVisible" track-by="$index"
5050
v-show="column.visible" :class="column.cellstyle">
5151
<span v-if="column.renderfunction!==false" v-html="column.renderfunction( column.name, entry )"></span>
@@ -307,6 +307,14 @@
307307
}
308308
}
309309
},
310+
/**
311+
* Function to handle row clicks
312+
*/
313+
rowClickHandler: {
314+
type: Function,
315+
required: false,
316+
default: function () {}
317+
},
310318
},
311319
data: function () {
312320
return {

src/app.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ var renderfu = function ( colname, entry) {
1010
'</div><span>'+JSON.stringify(entry)+'</span>';
1111
};
1212

13+
var handleRow = function (event, entry) {
14+
console.log("CLICK ROW: " + JSON.stringify(entry));
15+
};
16+
1317
new Vue({
1418
el: '#app',
1519
components: {
@@ -21,6 +25,7 @@ new Vue({
2125
showPicker: true,
2226
paginated: true,
2327
multiColumnSortable: true,
28+
handleRowFunction: handleRow,
2429
ajax: {
2530
enabled: false,
2631
url: "http://localhost:9430/data/test",

0 commit comments

Comments
 (0)