how to strike-through the text, in selected/checked row, in Bootstrap-table,
Asked Answered
S

2

11

I have a Bootstrap-table

<table id="tblTodaysNews"
..
data-click-to-select="true"
data-response-handler="responseHandler">
<thead>
    <tr>
    <th data-field="Select" data-checkbox="true" data-align="center" valign-align="middle" data-width="5px"></th>
    <th data-field="ID" data-visible="false"></th>
    <th data-field="Title" data-title="Title" data-align="left" valign-align="middle" data-width="auto"></th>
    <th data-field="Description" data-title="Message" data-align="left" valign-align="middle" data-width="70%"></th>
    ...     

What i want to do is that when user checks any check-box, in 'Select' data-field, the Title and Description, change their appearance, say, strike-through/Italic. I want to use this ‘checkbox’ to give a visual indication to the user that these rows will be deleted from the database, once user click, a separate, ‘Delete’ button.

Thanks in advance.

Seleneselenious answered 10/9, 2015 at 14:30 Comment(1)
could you accept one of the answers on this question please? thanks!Columbarium
C
26

Try this

tr.selected {
  text-decoration: line-through;
}

Here's a working fiddle: http://jsfiddle.net/e3nk137y/11801/

Columbarium answered 18/2, 2017 at 21:4 Comment(0)
U
0

Not too sure about checking for what is selected. jQuery may be useful in that scenario. Although, the CSS for this will be:

text-decoration: Line-Through
Uribe answered 10/9, 2015 at 14:35 Comment(3)
thanks Harvey, but i don't know how to get hold of that element, whose CSS I have to change to get this effect.Seleneselenious
You could try adapting this JSFiddle example. This example is for expanding rows, but the jQuery will aid to select a particular row, I hope this helps! jsfiddle.net/mfwYSUribe
Duplicate AnswerArtair

© 2022 - 2024 — McMap. All rights reserved.