Announcement

Collapse
No announcement yet.

Search form on the same page

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

  • Search form on the same page

    Hi,

    I m trying to build a form with a search tool on the top, and as soon as the date is entered and the OK button is validated/pressed, it will filter the content of the grid (report) accordingly ON THE SAME PAGE - maybe using the CONTAINER application.

    I have seen many examples but none of it are showing how to filter using parameter ON THE SAME PAGE. One example is showing what I want but I have no idea what this mean

    {details} = "<a href=\"javascript:void%200\" onclick=\"parent.document.getElementById('id-iframe-widget4').contentWindow.document.location.href = '../samples_grid_order_details/samples_grid_order_details.php'+'?ord=".{orderid}. "';\" > <img src='../_lib/img/details.png' border = '0' Title='Details'/></a>";

    Presumably this is passing only ONE parameter {orderid}. What if I have a few parameters to be passed?

    Help is highly appreciated.

  • #2
    The trick is that you have to refresh certain parts of the screen which are maintained by IFrames. Point is that you cannot move data to another frame as you can with i.e. <DIV> 's. What you might consider is to generate a sc_redir to the same container using _parent so that your full container is refreshed. If the internet connection is fast enough you hardly see the page refreshing. You can pass the searchcritera then by using global variables and assign these to the SQL you have. It's an approach I use often. I also use refresh on iframes but then you need to look into the generated code to find out names. But I always use sc_redir. I'm not a javascript specialist.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      Thank you Albert. Initially it didn't work cause I had the containers set on one left and one right. When I sc_redir back to the parents page, it just created another WHOLE page on the left widget with both widgets on the left container, leaving the right container unchanged.

      It work when I switched the container to one on top (date filtering) and one at the bottom (result set). The whole page was sc_redir, and it refreshed the whole page giving the desired result on the bottom widget.

      I was hoping that there was a better way that can work like the LINK app, whereby I could just type in the date to filter, click the OK button, and the results will be displayed at the bottom.

      Appreciate it!

      GT

      Comment


      • #4
        You can afaik use your construction, but instead of _parent you need to name the correct unit where to put the container in. But you have to hack into the code to find out which name you need. I use firefox with a plugin showing classes etc. but F12 will reveal things too, or 'inspect element'.

        This is one of the things in my wishlist for SC to be able to pass data better around. But as long as it is bound to iframes in stead of divs it will be difficult I guess.
        Last edited by aducom; 04-13-2013, 02:38 PM.
        Albert Drent
        aducom software netherlands
        scriptcase partner, reseller, support and (turn-key) development
        www.scriptcase.eu / www.scriptcase.nl

        Comment

        Working...
        X