What is the quickest way to obtain the next node of a line using jQuery? Here is the generated markup of a TreeList which is a type of GridView asp.net. I have to have to obtain the lblWorkItemId which is 199. Please consider that this is from a bound control.
<tr id="ctl00_PageContent_rtlRshItems_ctl04__2" class="rtlR rtlRL" style="background-color:Lavender;">
<td align="left" valign="middle" style="width:90px;">
<div id="ctl00_PageContent_rtlRshItems_ctl04_rcbStatut" class="RadComboBox RadComboBox_Windows7">
<table class="rcbFocused" style="border-width: 0pt; border-collapse: collapse;" summary="combobox">
<tbody>
<tr class="rcbReadOnly">
<td class="rcbInputCell rcbInputCellLeft" style="width:100%;">
<input id="ctl00_PageContent_rtlRshItems_ctl04_rcbStatut_Input" class="rcbInput" type="text" readonly="readonly" value="Submitted" name="ctl00$PageContent$rtlRshItems$ctl04$rcbStatut" autocomplete="off">
</td>
<td class="rcbArrowCell rcbArrowCellRight">
<a id="ctl00_PageContent_rtlRshItems_ctl04_rcbStatut_Arrow" style="overflow: hidden;display: block;position: relative;outline: none;">select</a>
</td>
</tr>
</tbody>
</table>
<input id="ctl00_PageContent_rtlRshItems_ctl04_rcbStatut_ClientState" type="hidden" name="ctl00_PageContent_rtlRshItems_ctl04_rcbStatut_ClientState" autocomplete="off">
</div>
</td>
<td class=" rtlCL" style="width:0px;">
<asp:label id="lblWorkItemId" text="199" visible="false"> </asp:label>
</td>
The following javascript method will be called when the selected value of the combobox will be changed to a certain value:
function OnClientSelectedIndexChanged(sender, eventArgs) {
var item = eventArgs.get_item();
if (item.get_text() == "Refused") {
var treeList = $find("<%= rtlRshItems.ClientID %>");
// var workItemId = [...]
OpenReasonWindow(workItemId);
}
}
Using your code template:
Note: I would typically apply this sort of handler unobtrusively, not in mark up.