Search code examples
jquerysearchflexigrid

Flexigrid - get search options dynamically with jquery


I am currently using flexigrid and able to find all selected rows using query using:

find("tr.trSelected")

I am now trying to get the current search options using similar methods but not able to get anything, I have already tried the below but there is no value:

find("input[name=q]").val()

I would appreciate if someone can point me to the right direction if possible.


Solution

  • Since I did not find a solution for the problem the way I was hoping for, I went around the problem using a different approach.

    • Add an extra column with name search and hide: true option
    • When sending the XML results on search, also send the extra column with
    $xml .= "<cell><![CDATA[".$qtype.'='.$query."]]></cell>";
    
    • Select the search data from the grid:
    $('[abbr="search"]',$(grid).find("tr:first")).text()
    

    So now I get my query string as well as the designated column.