Skip to content

Commit e28b46f

Browse files
author
syshex
committed
update docs and renderfucntion part
1 parent e9a61ff commit e28b46f

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ The `columns` array takes object of type:
230230
editable: Boolean, // Optional: column cells editable? (Default: false)
231231
columnstyle: String // Optional: styles to be applied to the Column Header
232232
cellstyle: String // Optional: styles to be applied to the Cells of this column
233-
renderfunction: Function // Optional: Function that receives as input the entry, and returns an HTML String for drawing cell
233+
renderfunction: Function // Optional: Function that receives as input the column name and entry, and returns an HTML String for drawing cell
234234
}
235235
}
236236
```
@@ -263,16 +263,16 @@ columns: [
263263
{
264264
title: "Test",
265265
visible: true,
266-
renderfunction: renderfu
266+
renderfunction: renderTestColumn
267267
}
268268
],
269269
```
270270

271-
There must be a javascript function called `renderfu` :
271+
There must be a javascript function called `renderTestColumn` :
272272

273273
```javascript
274274
<script>
275-
var renderfu = function (entry) {
275+
var renderTestColumn = function (colname, entry) {
276276
return '<div class="btn-group" role="group" >'+
277277
' <button type="button" class="btn btn-sm btn-primary"><span class="glyphicon glyphicon-ok" aria-hidden="true"></span></button>'+
278278
' <button type="button" class="btn btn-sm btn-danger"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button>'+

dist/vue-bootstrap-table.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.

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: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/VueBootstrapTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<tr v-for="entry in filteredValuesSorted " track-by="$index">
4949
<td v-for="column in displayColsVisible" track-by="$index"
5050
v-show="column.visible" :class="column.cellstyle">
51-
<span v-if="column.renderfunction!==false" v-html="column.renderfunction( entry )"></span>
51+
<span v-if="column.renderfunction!==false" v-html="column.renderfunction( column.name, entry )"></span>
5252
<span v-if="column.renderfunction===false && !column.editable"> {{ entry[column.name] }} </span>
5353
<value-field-section v-if="column.renderfunction===false && column.editable"
5454
:entry="entry"

src/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Vue.config.devtools = true;
33

44
import VueBootstrapTable from './VueBootstrapTable.vue';
55

6-
var renderfu = function (entry) {
6+
var renderfu = function ( colname, entry) {
77
return '<div class="btn-group" role="group" >'+
88
' <button type="button" class="btn btn-sm btn-primary"><span class="glyphicon glyphicon-ok" aria-hidden="true"></span></button>'+
99
' <button type="button" class="btn btn-sm btn-danger"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button>'+

0 commit comments

Comments
 (0)