setfocus - Set focus on dataTable in javascript -
<table id="table-dispatch" class="display data-table" cellspacing="0" width="100%" onclick="showrequestmap()"> <thead> <tr> <th> id </th> <th> status </th> <th> client </th> <th> client phone number </th> <th> dispatch date </th> <th> driver </th> <th> distance </th> <th> current location </th> <th> estimated fare </th> <th> action </th> </tr> </thead> <tbody> <tr> <td>5</td> <td> waiting pickup </td> <td> raj </td> <td> 85115 </td> <td> apr 18, 2016 7:07 pm </td> <td> tushar patel </td> <td> nan </td> <td> thaltej, ahmedabad, gujarat 380054, india </td> <td> 0$ </td> <td> action </td> </tr> </tbody> </table> </div>
this datatable. , how set focus method on datatable in javascript.
$(document).ready(function(){ $("#table-dispatch").focus(function() { }); });
this javascript code.i try focus method on datatable id. not work. how can focus method use on datatable. please give me solution. , how give first priority focus method before on-click method.
just @ these code, it's not hover, achieve same functionality mouseover() function.
jsfiddle : https://jsfiddle.net/eua98tqa/12/
jquery:
$('#table-dispatch').mouseover(function(){ $(this).css('background-color','#ddd'); }).mouseout(function(){ $(this).css('background-color','#bbb'); });
Comments
Post a Comment