Using ew_Ajax()

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.

Using ew_Ajax()

Postby dire » Sun Sep 24, 2017 1:41 pm

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
dire
 
Posts: 34
Joined: Mon Sep 26, 2016 7:53 pm

Re: Using ew_Ajax()

Postby Webmaster » Mon Sep 25, 2017 9:42 am

$(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.
Webmaster
 
Posts: 10733
Joined: Fri Aug 06, 2004 5:59 pm


Return to General Discussion (ASP.NET Maker)