Announcement

Collapse
No announcement yet.

Default Filter Value on Grid Application

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

  • Default Filter Value on Grid Application

    Hi All,

    I have a product list displayed in Grid Application. However, I would like to show only active products when open, but I can also displayed inactive products through Advanced Search.

    How can I achieve this? Thank you in advance.

    Daniel

  • #2
    I have a workaround although not quite satisfied.

    // -----
    if (empty({sc_where_current})) {
    sc_select_where(add) = "where status = 1";
    }
    // -----

    Add these lines in event -> onScriptInit

    Does anyone have better solution?

    Daniel

    Comment


    • #3
      Originally posted by adinugro View Post
      I have a workaround although not quite satisfied.

      // -----
      if (empty({sc_where_current})) {
      sc_select_where(add) = "where status = 1";
      }
      // -----

      Add these lines in event -> onScriptInit

      Does anyone have better solution?

      Daniel
      This achieves your purpose in 3 lines of code. Why are you not satisfied? Or does it not work?

      Comment


      • #4
        It works great but still I am looking for more elegance way to do it (GUI ways rather than script code).

        Thanks anyway for your response.

        Comment

        Working...
        X