I have dynamic table generated via jQuery
using append
. The first row contains table header
. Second contains input fields (text fields, dropdown menu's etc). Third and others contains table content.
$el.append('<tr>
<td>ID</td>
\
<td>Name</td>
\
<td>Something</td>
\
<td>Something</td>
\
<td>Something</td>
\
<td></td>
\
<td></td>
\
<td></td>
\
</tr>
\
<tr>
<td>
<input name="test-id" id="test-id" class="machine_management" maxlength="5" type="hidden"/>
</td>
\
<td></td>
\
<td></td>
\
<td>HERE MENU</td>
\
<td></td>
\
<td></td>
\
<td></td>
\
<td></td>
\
</tr>
\
');
and ajax({ // generate table content});
My problem is that i don't know how to create dynamic dropdown
menu inside row 2
( HERE MENU). Any ideas? I believe should be another ajax
call inside? this append
? Or create variable and add these values as a long string (variable
= variable + value
;) and then post in row 2
? I hope my question is clear enough.
Your HERE MENU
is going to need to be replaced with a <select>
list. If you try to do it using nested AJAX calls, you are just looking for headaches - as you've guessed, you want to do a separate AJAX call, create the string in a variable, and insert it instead of your place-holder.