Multiple data fields in bootstrap table
bootstrap-table, twitter-bootstrap
Solution
Perhaps try the "data-formatter" in the column section of http://bootstrap-table.wenzhixin.net.cn/documentation/ ?
The template:
<table>
<th data-field="firstname"
data-formatter="nameFormatter"></th>
</table>
The javascript:
function nameFormatter(value, row, index) {
return value + " " + row.lastname;
}
Problem
In my database, I have fields fname and lname. I am using a Bootstrap Table to display the results to the user. What I would like to do is concatenate the two fields to display under one column called Name. This currently works, albeit it the first and last name are in separate columns. I want to combine them into the same column. ``` <th data-field="fname">First Name</th> <th data-field="lname">Last Name</th> <th data-field="title">Title</th> <th data-field="position">Position</th> <th data-field="cell">Cell</th> <th data-field="home">Home</th> <th data-field="workgroup">Workgroup</th> ``` I searched the documentation, but didn't see any examples. Thanks!