Announcement

Collapse
No announcement yet.

javascript button in a grid application - how to access [global_variable]?

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

  • javascript button in a grid application - how to access [global_variable]?

    I have a grid application and i also created a javascript button.

    in the button's javascript code, I attempted this

    var java_variable = [global_variable];

    but it doesn't work.

    how can i resolve this?

  • #2
    Javacript code is not parsed by SC.
    1. Create a JS function to modify some JS var.
    2. Call this JS function from some PHP event/button, witgh the global you want to pass as param.
    3. Enjoy


    /Giuseppe

    Professional Scriptcase Services
    Some Customers opinions

    Comment


    • #3
      Giu,

      is the second screenshot correct?

      You're passing 'IN_var' to the JS function but you're assigning an hardcoded value to 'testing' (987654).

      Shouldn' it be like this?:

      Code:
      testing = IN_var;

      Comment


      • #4
        Giu,

        i'm using a grid application, so javascript methods do not exist.
        hoping to find a way to in javaascript to get the global variable..

        Comment


        • #5
          Yes robydago, I was just testing and forgot to update the screenshoot.

          Demund, instead to create the function in JS functions, echo it onApplicationInit
          /Giuseppe

          Professional Scriptcase Services
          Some Customers opinions

          Comment


          • #6
            I like this function for access global variable. in my case, my way for do it was: create a new field and assign the global variable and then javascript can acces to field.

            Comment


            • #7
              Originally posted by alvagar View Post
              I like this function for access global variable. in my case, my way for do it was: create a new field and assign the global variable and then javascript can acces to field.
              of course, your option is another valid way to do it
              /Giuseppe

              Professional Scriptcase Services
              Some Customers opinions

              Comment

              Working...
              X