drvic10k / bootstrap-sortable

adding sorting ability to bootstrap table
MIT License
513 stars 131 forks source link

data-value doesn't sort if td contents is a <select> #128

Open FrankEBailey opened 4 years ago

FrankEBailey commented 4 years ago

Hi, I add a data-value attribute to my table cell that contains a dropdown select with supplier names in it, this data-value being the supplier name that's currently selected in the application for that line. When I click on the column header, no sorting happens, even though the asc/desc arrows do change for the column.

drvic10k commented 4 years ago

are you updating the attribute everytime the dropdown value is changed?

FrankEBailey commented 4 years ago

I'm don't expect the table to sort if I've updated the value, just the initial values on page load. No sorting is occurring at all on clicking on the column header. When I click, the column header th, all the row td's get the sorted class, however the table rows aren't getting sorted at all.

A snippet of the relevant cell from one of my table rows:

<td data-value="Studio256 Parts">
<select name="Supplier_1" id="Supplier_1" class="form-control selSupplier" style="padding:2px;">
    <option value="">...</option>
    <option value="-1" >STOCK</option>
    <option  data-supplier="893" data-type="" value="893">AAD Commercial Parts</option>
    <option value="..." >etc ...</option>
</select>
</td>
FrankEBailey commented 4 years ago

Any further ideas on this?