Announcement

Collapse
No announcement yet.

Passing Checkbox values from a control app to a grid

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

  • Passing Checkbox values from a control app to a grid

    Hi,

    The following tutorial video shows how to pass a global variable to another application.
    http://www.scriptcase.net/scriptcase...asic-concepts/

    However, it doesn't explain how to pass multiple values such as checkboxes (global variable from a control app) to filter a grid.

    SO my questions are:
    a. how to pass a multi-dimensional global variable (from checkboxes) from a control app to a grid app?
    b. how to get the checkbox values recognised by the MySQL 'where clause' in the grid?

    Thanks.

  • #2
    Originally posted by Henry View Post
    Hi,

    The following tutorial video shows how to pass a global variable to another application.
    http://www.scriptcase.net/scriptcase...asic-concepts/

    However, it doesn't explain how to pass multiple values such as checkboxes (global variable from a control app) to filter a grid.

    SO my questions are:
    a. how to pass a multi-dimensional global variable (from checkboxes) from a control app to a grid app?
    b. how to get the checkbox values recognised by the MySQL 'where clause' in the grid?

    Thanks.
    AFAIK there's not a real difference in passing variables as singular, array or multi-dimensional array. But to be honest I don't know exactly how SC works with global variables internally. But if it is an issue you have always the opportunity to transform an array into a simple variable using implode. Then you pass the value to a global and in your other application you transform that variable back into an array using php explode method.

    If you need to filter the sql you need to apply a where clause. This too can contain a global variable like: where [glob_where]
    To set the glob_where global you must need an event like onscriptinit. In this event you can check the passed variables and create your where.

    If things not seem to work you can go to the application section of your module and check the debug options. Your application will show every generated sql statement before execution and allows you to check your settings.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      Thanks Albert.
      I followed your suggestion. The problem is scriptcase use the semicolon (as opposed to comma) to separate checkbox values.
      php's 'str_replace()' did the trick before sending to the 'where' clause.

      Comment

      Working...
      X