How to set focus on search box of asp.net Gridview

How to set focus on search box of asp.net Gridview

sumitsumit Posts: 1Questions: 1Answers: 0

Link to test case:
I am opening my datatable into modal popup.
var table = $('#<%= GrdHelpingWindow.ClientID%>').prepend($("<thead></thead>").append($("#<%= GrdHelpingWindow.ClientID%>").find("tr:first"))).DataTable({
destroy: true,
pagingType: "first_last_numbers",
scrollX: false,
scrollCollapse: false,

            });

Now i want to set default focus on search box.
i was using below code to set focus on search box but its not working .
$("#GrdHelpingWindow_filter [type='search']").focus();

Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:

Answers

  • colincolin Posts: 9,003Questions: 0Answers: 1,501

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

Sign In or Register to comment.