We have a table with a set of data and have a button click to validate the data for one reason or another. I would like change to row style of a row that isn't valid. Say I have 4 rows and after all of the data is validate we find that the data in the 3 row is invalid, can we change the row to be red to show this is an invalid row?
Is there a way to do that now? It doesn't seem so but I wanted to ask before I start looking at creating an extension to do this.
Thanks in advance
See this example http://issues.wenzhixin.net.cn/bootstrap-table/#issues/563.html let me know if this works for you
Good morning @djhvscf
http://issues.wenzhixin.net.cn/bootstrap-table/#options/table-style.html
I think the rowStyle option is what @rpannell want.
function rowStyle(row, index) {
If (!row.valid) {
return {css: {color: 'red'}};
}
return {};
}
row style would when the data is loaded, I need something after the data is loaded and it's not an event. I want to be able to search the table, find my row and then update the row styling. I know I can use jquery searching the date-index field on the TR element, but didn't know if there was something build into bootstrap table to do that so to cover all of the other necessary css change for that row to happen. Basically I would need the ability to run the "rowStyle" function after the data is loaded by a row index or an unique id.
I can write an extension to handle thison my end, I already have a couple of extensions that at some point would like to make public, just need permission from my company to do that.
Great! So in your case there is not any built-in function in order to do that. Let us know if we can have your extensions
Hi,
im having a similar issue,
return { 'css': { 'font-weight':'bold' } }$('#messagestable tbody tr[data-uniqueid="'+index+'"] td').css({'font-weight':''});Use a custom extension to solve this issue.
Most helpful comment
Good morning @djhvscf
http://issues.wenzhixin.net.cn/bootstrap-table/#options/table-style.html
I think the
rowStyleoption is what @rpannell want.