I am using folowing library : http://bootstrap-table.wenzhixin.net.cn/documentation/
I load json objects into this table which works fine, but now here comes the problem. I want to be able to sort columns.
My Json layout as folows :
[{Total: 12345.56, Name: Monkey1, TotalFormatted: $ 12.345,56},{Total: 13345.56, Name: Monkey3, TotalFormatted: $ 13.345,56},{Total: 11345.56, Name: Monkey2, TotalFormatted: $ 11.345,56}]
<table id=test data-page-size=10 data-pagination=true data-unique-id=true data-show-footer=false>
<thead>
<tr>
<th data-field=Name>Name</th>
<th data-field=TotalFormatted data-sort-name=Total data-sortable=true data-align=right>TotalFormatted</th>
</tr>
</thead>
</table>
I want to show TotalFormatted data, but i want to sort this column with Total property, since TotalFormatted cant be used for that. In the documentation i saw the following :
data-sort-name : Provide a customizable sort-name, not the default
sort-name in the header, or the field name of the column. For example,
a column might display the value of fieldName of html such as
abc, but a fieldName to sort
is content with the value of abc.
but how ever data is not sorted correctly, has anyone exprienced this or have i misunderstood something?