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

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

sumitsumit Posts: 5Questions: 3Answers: 0
edited April 10 in Free community support

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:

Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586
    Answer ✓

    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

This discussion has been closed.