Alpha Video Training
Results 1 to 3 of 3

Thread: onGridinitialize emit javascript?

  1. #1
    Member
    Real Name
    Catalin
    Join Date
    Apr 2013
    Location
    Madrid
    Posts
    204

    Default onGridinitialize emit javascript?

    How can I do that? Not all events has e.javascript?

    if e.ajaxCallback = .f. then
    e.javascript = "{grid.object}.setValue('S','COD_PROCEDURE','2');"
    end if


    Thanks,
    Catalin

  2. #2
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,639

    Default Re: onGridinitialize emit javascript?

    Hi Catalin,

    I'm not sure that e.ajaxCallback is available in Server side onGridInitialize. It is available in onGridExecute, but you have the same problem with e.javascript.

    how about using the Client side event onGridInitializeComplete. HTML should be all set when this fires so you should be able to set a value here. And... onGridInitializeComplete doesn't fire on Ajax Callbacks.

  3. #3
    Member
    Real Name
    Catalin
    Join Date
    Apr 2013
    Location
    Madrid
    Posts
    204

    Default Re: onGridinitialize emit javascript?

    Hi David,
    Finally I use the client side event onGridInitializeComplete to make an ajax callback.
    {grid.Object}.ajaxCallback('G','{Grid.RowNumber}:all','SetSessionVariable','','',{});

    In this xbasic function I retrieve the parameter that I want to pass to the control.
    function SetSessionVariable as c (e as p)

    if variable_exists("e.__si.__vp__placeHolderValues") then
    tip_achizitor = word(word(e.__si.__vp__placeHolderValues, 1, "||"),2,"=")
    SetSessionVariable = "{grid.object}.setValue('S','IDTIPACHIZITOR'," + tip_achizitor + ");"
    end if

    end function


    Thank you very much for point me to the right direction.
    Catalin

Similar Threads

  1. Can I force OnGridInitialize to fire ?
    By Ezslim in forum Application Server Version 10 - Web/Browser Applications
    Replies: 2
    Last Post: 02-19-2011, 09:30 PM
  2. OnGridInitialize dynamicially hide field
    By phannon in forum Application Server Version 10 - Web/Browser Applications
    Replies: 6
    Last Post: 11-05-2010, 04:31 PM
  3. Using session variable in OnGridInitialize
    By shattuck49 in forum Application Server Version 10 - Web/Browser Applications
    Replies: 4
    Last Post: 07-23-2010, 08:05 PM
  4. OnGridInitialize variable question
    By Ken Tjia in forum Application Server Version 10 - Web/Browser Applications
    Replies: 2
    Last Post: 06-02-2010, 07:08 PM
  5. OnGridInitialize Question
    By envisionsolutions in forum Application Server Version 10 - Web/Browser Applications
    Replies: 0
    Last Post: 03-31-2010, 01:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •