0
我實際上有一個要求,從服務url
生成動態表,然後生成動態表。這是我工作,但我想要的是如何在表格行中生成動態按鈕並在按鈕上單擊打開新頁面
- 如何使用點擊事件在每個表格行上生成動態按鈕。
- 生成按鈕後,我們如何分配點擊事件按鈕我的意思是假設在一個表中有四個列,如日期,身份證號碼,名稱,位置和點擊每列或與該單元格相關它必須重定向到一個新頁面。
或
如果一個錶行被點擊和有4列有喜歡日期,ID號,名稱,位置點擊事件具有將採取日期作爲參數,然後單擊事件函數,然後必須再進行下一頁/重定向
$('#btn_Day').click(function() { var ex = document.getElementById("dpp_info"); var clOptions = ex.options[ex.selectedIndex].value; var clOptions1 = ex.options[ex.selectedIndex].text; var dt = todaydate; var dt1 = todaydate; $.ajax({ type: 'GET', url: xxxxx.xxxxx.xxxxx, data: frmDate_=" + dt + "&toDate_=" + dt1 + "", success: function (resp) { var Location = resp; var tr; for (var i = 0; i < Location.length; i++) { tr = tr + "<tr>"; tr = tr + "<td style='height:20px' align='left'>" + Location[i].Name + "</td>"; tr = tr + "<td style='height:20px' align='left'>" + Location[i].Date + "</td>"; tr = tr + "<td style='height:20px' align='left'>" + Location[i].IdNum + "</td>"; tr = tr + "</tr>"; }; document.getElementById('Wise').innerHTML = "<table class='r'>" + "<tr><thead ><th style='height:20px'>Location</th>" + "<th style='height:20px'>Date</th>" + "<th style='height:20px'>Id Num</th>" + "</tr></thead>" + tr + "<tr></tr>" + "</table>"; document.getElementById('Wise').childNodes[0].nodeValue = null; }, error: function (e) { window.plugins.toast.showLongBottom("Please Enable your Internet connection"); } }); });
現在
圖像中,如果你看到有四列,如果我在idnumb點擊,有記錄與特定數量必須顯示在單獨的頁面
尋求幫助想!
不知道我完全理解你想要做什麼,但它聽起來像你想添加處理日期,身份證號碼,姓名和位置的小提琴。你可以添加一個類到列/行和你需要的任何其他屬性,如data-name ='number'。一旦你將這個添加到dom中,你可以添加該類的處理程序? –
@JamesDale請檢查問題 – Madpop
因此,如果我點擊22,它會顯示IdNum爲22的其他記錄? –