Forums

Forums / Developing Portals / Show search on top of the grid

Show search on top of the grid

3 posts, 1 answered
  1. Mahesh Veeramalla
    Mahesh Veeramalla avatar
    8 posts
    Registered:
    02 Mar 2023
    22 Aug 2023
    Link to this post
    Hi, 

    Is there a possibility to show a search text box on top of the TPC grid's? We have search by column hidden some where inside. We wanted to bring that up so users do have to look for where to search. 

    Thanks
    Mahesh
  2. Rawdon Edghill
    Rawdon Edghill avatar
    76 posts
    Registered:
    16 Dec 2020
    Answered
    22 Aug 2023
    Link to this post
    Hi Mahesh,

    Yes, there is a possibility to show a search text box on top of the TPC grid.

    Kindly see the below code you can try to accomplish this.

    //Grid Functionality
    $(document).on("tpc:ready", function(){
        var grid = tpc.find("TpcGridModel").get_grid();
        var options = grid.getOptions();
        options.toolbar.push("search");
        options.search = {fields: ["fieldName"]};
        grid.setOptions(options); 
    });

    I hope this helps.

    Regards,
    Rawdon
  3. Mahesh Veeramalla
    Mahesh Veeramalla avatar
    8 posts
    Registered:
    02 Mar 2023
    23 Aug 2023 in reply to Rawdon Edghill
    Link to this post
    It Worked Rawdon, Thanks 
3 posts, 1 answered