duanfang7757 2017-04-03 13:29
浏览 125

在jQuery追加内部生成动态下拉菜单

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.

  • 写回答

1条回答 默认 最新

  • doukanwa6872 2017-04-03 14:08
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog