Welcome! Log In Create A New Profile

Advanced

[WB26] - Update a table

Posted by JP 
JP
[WB26] - Update a table
August 03, 2021 12:53PM
Hi All

Using WebDev26

Trying to update a table in a page:

1) I have a Browser table on a page

2) From browser code I call a Server script using AjaxExecute() to get the table data

3) The browser code gets the data (confirmed) and uses TableAddLine() To add the data to the table

4) But the table does not reflect the new data.

Q) Do I need to do a table refresh or something?

I tried another way:

1) Changed the table to an Ajax table

2) Call the server script which itself adds the data to the table directly from the server code

3) Again the table does not reflect the new data

Q) Is there a table refresh I need to do or similar?

Which option is best? Browser table calling server for the data and doing the update in the browser code or Ajax table and doing the table update from the server?

TIA



Edited 1 time(s). Last edit at 08/03/2021 01:09PM by JP.
Argus
Re: [WB26] - Update a table
August 03, 2021 01:59PM
I would use a tabledisplay function
JP
Re: [WB26] - Update a table
August 03, 2021 03:33PM
Argus

TableDisplay() is a server function only. Therefore the table must be an Ajax table and the server adds the data to the table. When I use it in the server code to update the table, the table still does not reflect the data I have added to it. iow - I can add data to the table in the server code but the table does not reflect the new data even using TableDisplay() ... ?
JP
Re: [WB26] - Update a table
August 03, 2021 04:20PM
Argus

Success smiling smiley I needed to use AjaxExecute() with the ajaxUpdateControls option. Then the table updates from the server code. No need for TableDisplay() in this case.

Thanks
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: