Page 1 of 1

Using ew_Ajax()

Posted: Sun Sep 24, 2017 1:41 pm
by dire

Hello,

I'm trying to get data from master into detail table. I choose folowing principle:

  1. Server - Table specific - Add/Copy Page - Page Load
    ew_SetClientVar("SqlFnd_PogObrObd", ew_Encrypt("SELECT fk_sif_obracunsko_obdobje_id FROM pogodba WHERE pogodba_id = {query_value}"));

  2. Client script - Table specific - Startup script
    var pogid = $(this).fields("fk_pogodba_id").value(); - From this field I get main ID
    var resObrObd = ew_Ajax(ewVar.SqlFnd_PogObrObd,pogid); - I run sql with main ID

  3. On specific field (where I want to get a value) i run
    $(this).fields("fk_sif_obracunsko_obdobje_id").value(resObrObd));

It doesn't work, any idea?

Thx


Re: Using ew_Ajax()

Posted: Mon Sep 25, 2017 9:42 am
by Webmaster

$(this).fields() won't work in Startup Script because "this" is window object in Startup Script. You should select the HTML element first.

To debug your codes, set a break point to your JavaScript codes (e.g. use Google Chrome Developer Tools) or use JavaScript alert codes to show the values.