Announcement

Collapse
No announcement yet.

Grid how to pass Quick Search text

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

  • Grid how to pass Quick Search text

    Hello

    I have external application from which I want to open scriptaces grid.

    At the moment I open it and it show list with all products.

    I want to open it and somhowe pass parameters in url ie.

    application/grid_x/?search=product

    how I can simply do that

    I have scriptcase 8.1

    Thank you for sugestions

  • #2
    Hallo,
    in general the parameter search is passed as a global variable, ie. [search]

    Thus you can code something in an event as onApplicationInit like

    PHP Code:
    if ([search]=='Hallo' ... 
    But I believe, that you want to show only the searched results.
    For that you can add a litte code to the SQL-statment of the grid like:

    PHP Code:
    SELECT
        id
    ,
        
    test_1
    FROM
        test_1
    WHERE 
    if('[search]'='',1=1,id='[search]'
    This would show only the rows with the id=1.
    The if statement is optional to show all records if search would be empty application/grid_x/?search=

    Sincerely

    Gunter
    Gunter Eibl
    email@GunterEibl.de

    asdw.de - Scriptcase & Open Source projects (German/English)
    scriptcase.coach - professional coaching for Scriptcase users (German)
    GunterEibl.de - About me (German)

    Comment

    Working...
    X