Hi ,
We have an HTML page which is using AJAX. We make an AJAX call which retrieves a table with mutiple rows. We need to extend this functionality. In the table, we want to put a button on each row. When this button is pressed, we want to update just the single row and keep the rest of the table the same.
Currently the AJAX call looks something like this:
document.getEle mentById("My_Di v").innerHTML=x mlHttp.response Text;
The server page returns the table as HTML dynamically and the returned HTML containing the table is fetched into the DIV.
--------------------------------------------------------
The problem is that the returned HTML Table is not visible in the original page source (as it is returned dynamically at run time). We need to reference a particular row in the returned Table and make another AJAX call inside the original AJAX call that fetches the RowID gets the new values and then updates just the one row.
--------------------------------------------------------
Call flow:
a) AJAX call
b) Server generates an HTML table
c) Client writes returned HTML into DIV
Required Call Flow:
a) AJAX call
b) Server generates an HTML table
c) Client writes returned HTML into DIV
d) Each HTML Table Row Has a Button (next) - Row_ID = N
e) On button Press Update Row_N with a new value fetched by different AJAX call.
-----------------------
We tried to implement the button call with the original code. The problem is that we are not able to reference the table because it is dynamically generated. How do you reference that table object to manipulate the rows.
Has anyone excountered this problem?
We have an HTML page which is using AJAX. We make an AJAX call which retrieves a table with mutiple rows. We need to extend this functionality. In the table, we want to put a button on each row. When this button is pressed, we want to update just the single row and keep the rest of the table the same.
Currently the AJAX call looks something like this:
document.getEle mentById("My_Di v").innerHTML=x mlHttp.response Text;
The server page returns the table as HTML dynamically and the returned HTML containing the table is fetched into the DIV.
--------------------------------------------------------
The problem is that the returned HTML Table is not visible in the original page source (as it is returned dynamically at run time). We need to reference a particular row in the returned Table and make another AJAX call inside the original AJAX call that fetches the RowID gets the new values and then updates just the one row.
--------------------------------------------------------
Call flow:
a) AJAX call
b) Server generates an HTML table
c) Client writes returned HTML into DIV
Required Call Flow:
a) AJAX call
b) Server generates an HTML table
c) Client writes returned HTML into DIV
d) Each HTML Table Row Has a Button (next) - Row_ID = N
e) On button Press Update Row_N with a new value fetched by different AJAX call.
-----------------------
We tried to implement the button call with the original code. The problem is that we are not able to reference the table because it is dynamically generated. How do you reference that table object to manipulate the rows.
Has anyone excountered this problem?
Comment