Announcement

Collapse
No announcement yet.

Set focus on Quick Search on a Grid app

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

  • Set focus on Quick Search on a Grid app

    Hi there,

    Does anyone know how to go about automatically set focus on the Quick Search box in a toolbar on a grid application. Any help much appreciated.

    Regards
    Junior Brandt

  • #2
    Grid -> Settings -> Start by Search = Yes
    Best regards: - Reinhard -

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

    Comment


    • #3
      Originally posted by RHS View Post
      Grid -> Settings -> Start by Search = Yes
      Thanks Richard, however, this only starts the app by showing the search form, it does not simply direct the focus to the Quick Search box in the app toolbar - which is what I (more precisely, the customer) wants..

      Any other ideas welcome

      Comment


      • #4
        Originally posted by symanix View Post
        Thanks Richard, however, this only starts the app by showing the search form, it does not simply direct the focus to the Quick Search box in the app toolbar - which is what I (more precisely, the customer) wants..

        Any other ideas welcome
        I'm not a javascript guru, but if you look into the html you can find the fieldname of the search field. Then apply a piece of javascript to set the focus?
        Albert Drent
        aducom software netherlands
        scriptcase partner, reseller, support and (turn-key) development
        www.scriptcase.eu / www.scriptcase.nl

        Comment


        • #5
          I was thinking along the same lines, but then I cannot run a java function using the onScriptInit event... If you can tell me how to get the java executed everytime the grid app is loaded, i.e an 'onLoad' event, then I could probably get it to work.. thanks for the comment :-)

          Comment


          • #6
            Just a thought (not tested).
            The page will need to get loaded and I dont see an onload event anywhere in the generated code. Hence you should be able to insert some onload code, so I guess that you could look for <body class= in the generated code and add an onload
            there by hand...

            Comment


            • #7
              have you tried to put an echo statement in the onscriptinit with the javascript procedure?

              Something like:

              echo " <script type='text/javascript>";
              echo " document.getElementById('fieldId').focus()";
              echo "</script>";

              or

              document.yourform.fieldname.focus();
              Albert Drent
              aducom software netherlands
              scriptcase partner, reseller, support and (turn-key) development
              www.scriptcase.eu / www.scriptcase.nl

              Comment

              Working...
              X