Announcement

Collapse
No announcement yet.

Reloading Grid

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

  • Reloading Grid

    Hello,

    I have an issue with managing my grid properly. Specifically, I'm trying to get the grid to reload its data.

    Basic Scenario:
    I have a grid with a where condition, that will - based on a variable - show or not show certain content. I have buttons that will manipulate this variable. However, after changing this, it should reload the grid to include/exclude as intended.

    What I tried:
    The only Macro I found, that should serve my purposes, is the sc_redir macro. With that I should theoretically be able to load the grid again. Only, it doesn't work that way. It will reload the application to some degree, but not rerun the sql statement.
    I have tried redirecting to another (blank) application that redirects back, but that too failed.

    What does work:
    clicking on the button works, however the user needs to do so manually - at least I know no way to automate this in scriptcase - making the entire experience highly unintuitive.

    So, any ideas on how I could realize this?

    Cheers

  • #2
    Did you tried with sc_ajax_refresh macro?


    /Giuseppe

    Professional Scriptcase Services
    Some Customers opinions

    Comment


    • #3
      Grid / Settings / Grid Settings / Refresh Interval
      Best regards: - Reinhard -

      I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

      Comment


      • #4
        Hi Guys,

        thanks for the input.

        @Giuseppe: The macro sounds good, but is not available in Grids. Actually, according to the documentation it's available nowhere. I tried using it anyway, but got an "unknown function" error.
        @Reinhard: Unfortunately, since this SQL statement isn't what you'd call swift (nested grids are a pain in the ass, as far as performance is concerned), frequent refreshs are not practical. Since the data is fairly slow to change, a bit older data is not too much of an issue. Refreshing will collapse all expanded nested grids and it will not update the query.

        That last point sent me on another tangent and I'll try out using the sc_select_where(add) macro - that might do the trick.

        Cheers

        Comment


        • #5
          Update:
          sc_select_where worked very well indeed and was just what I needed to use:
          - Used an if/else condition in the "OnScriptInit" event of the grid, calling sc_select_where with the where clause needed
          - Used an sc_redir on the buttons
          Both combined did the job of properly editing the where condition between refreshs.

          Note:
          It has proved easier to do the whole WHERE-clause in the sc_select_where call, rather than modify an already existing one.

          Comment


          • #6
            http://www.scriptcase.net/docs/en_us...os.htm#sc_exit

            Notwithstanding the name, some of its options will make it return to the current app itself and refresh\reload data.

            I used sc_exit(sel) in a form php button to force reloading the data. It should work with grids as well.

            Comment


            • #7
              If you have both Quicksearch and sc_select_where in the same grid, double check that quicksearch is still working:

              http://www.scriptcase.net/forum/foru...re-add-is-used

              Comment

              Working...
              X