Selectable in Jquery table with css class -
i tried use selectable on table has css class assigned. removing css class select works fine, assigned class nothing happens. think related css definition cannot find out how.
<table id="sel-table" class="stats"> <thead> <tr> <th>id</th> <th>customer</th> <th>servername</th> <th>ip</th> <th>port</th> <th>port2</th> <th>gid</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>cust1</td> <td>testmachine</td> <td>127.0.0.1</td> <td>11970</td> <td>30035</td> <td>2</td> </tr> <tr> <td>2</td> <td>cust2</td> <td>testmachine</td> <td>127.0.0.1</td> <td>11970</td> <td>30035</td> <td>2</td> </tr> </tbody> </table>
table.stats { text-align: center; font-family: verdana, geneva, arial, helvetica, sans-serif ; font-weight: normal; font-size: 11px; color: #fff; width: 580px; background-color: #666; border: 0px; border-collapse: collapse; border-spacing: 0px; } table.stats td { background-color: #ccc; color: #000; padding: 4px; text-align: left; border: 1px #fff solid; } table.stats td.hed { background-color: #666; color: #fff; padding: 4px; text-align: left; border-bottom: 2px #fff solid; font-size: 12px; font-weight: bold; } #sel-table .ui-selecting { background-color: #feca40 } #sel-table .ui-selected { background-color: #f39814; color: white; }
$("#sel-table>tbody").selectable({ filter: 'tr' });
can tell me missing?
example here https://jsfiddle.net/tmoeller/pg9264d1/
cheers
tmoe
$("#sel-table tbody tr").selectable(); // selectable td elements
if want make entire tr selectable use:
$("#sel-table tbody").selectable(); // selectable tr elements
but need alter css accordingly (cause selected class in not more td tr)
#sel-table .ui-selecting td { background-color: #feca40; } #sel-table .ui-selected td { background-color: #f39814; color: white; }
Comments
Post a Comment