Announcement

Collapse
No announcement yet.

Quick Search field -How to determine if it has been used & also how to clear the text

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Quick Search field -How to determine if it has been used & also how to clear the text

    Hi All,

    I have a 'Show Selected' (run-type button) and a 'Show All' button on my grid, so that the user can selected individual rows and filtered them out using the Show Selected button.
    Then, when the grid refreshes the 'Show All' button appears so the user can see all records again.
    However, this technique does not take into account the Quick Search field. ie. the Show All button will still be filtered by the text the user typed in the Quick Search field

    So, does anyone know of a way to determine whether the user has typed something into the Quick Search field?

    I checked the 'Data in Session' page after I'd done a search for the word "rabbit" in the Quick Search field, and I found the string was in the following areas of the grid application that I was running...

    where_pesq
    where_pesq_ant
    where_pesq_fast
    fast_search

    However, I'm not sure how to get access to these variables.

    I did also think of pulling the total no. of rows in the grid somehow, so if I compare the no. of records displayed in the grid with the no. of rows in the table, then I'll be able to tell if any filter has been applied.

    Any ideas on how to get access to the total no. of records in the grid?
    eg. to get the number 243 out of the navigation details [1 to 12 of 243]

    My last question is how I could programmatically clear the text in the Quick Search field if the user clicks on the Show All button?

    With Thanks,
    Chris



  • #2
    how I could programmatically clear the text in the Quick Search field if the user clicks on the Show All button?
    In the Javascript Onclick event add: document.getElementById('fieldname').value=''; where fieldname is the name of the Quicksearch text field (you can get this using the Inspect Element option or Developer Tools in Chrome)

    Comment


    • #3
      Ok, thanks landame.
      I'll give it a go. Not that familiar yet with Inspecting in Firefox

      Comment


      • #4
        Hi Again,

        I've tried to clear the Quick Search field with the following code for the Show All button, however it just ignores the 2 lines in the middle

        [gstr_WorldRegionIDs] = "ALL";
        ?>

        document.getElementById('SC_fast_search_top').valu e = '';
        nm_gp_submit_qsearch('top');

        <?php
        sc_redir(grid_world_regions);

        Can someone let me know what I'm doing wring please?
        Thanks,
        Chris

        Comment

        Working...
        X