在我的asp.net形式,錶行我補充細胞內這些細胞中的我像一個屬性添加文本框 -查找特定行屬性的jQuery
string residentId = (new GUID()).ToString();
string houseId = (new GUID()).ToString();
HtmlTableRow detailRow = new HtmlTableRow();
detailRow.Attributes.Add("residentId", residentId);
detailRow.Attributes.Add("houseId", houseId);
HtmlTableCell dataCell = new HtmlTableCell();
TextBox tb = new TextBox();
tb.Attributes.Add("componentname", "tbMoveInDate");
tb.Attributes.Add("onchange", "updateMoveInDate()";
cell.Controls.Add(tb);
detailRow.Cells.Add(dataCell);
與100+行的possiblility,所有當然有不同的ID。
我在JavaScript中我有這個功能 -
function updateMoveInDate() {
var MoveInDateEle = $("[componentname*='tbMoveInDate']");
}
在這一點上MoveInDateEle是所有的這些文本框的表內的收集和
var currentRow = $("[componentname*='tbMoveInDate']").parent().parent();
給了我所有的行。但不是我的特定行。
如何獲得我正在使用的特定文本框以及與該控件關聯的特定居民ID和房屋ID?
你點擊你正在使用或什麼'工作with'意味着行?文本框會被重點關注嗎?你介意多解釋一下。謝謝 – edhedges