jquery - Bootstrap Table - To change the background color row -
i need change background color row, not working well.
this js code:
$("#table-results").bootstraptable({ method: 'get', url: '/json/data-results.json', columns: [{ field: 'type' }, { field: 'customer_name' }, { field: 'address' }, { field: 'img', align: 'center' }], onloadsuccess: function(res) { $("#table-results").on('click-row.bs.table', function (e, row, $element) { $($element).addclass('danger'); }); } });
other way (but not working)
$("#table-results").bootstraptable({ columns: [{ field: 'type' }, { field: 'customer_name' }, { field: 'address' }, { field: 'img', align: 'center' }], onclickrow: function (row, $element) { $($element).addclass('active').siblings().removeclass('active'); //$($element).addclass('danger'); } });
this css code:
.danger { background-color: red !important; }
which problem?, thanks,
Comments
Post a Comment