<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Getting parent id of radio button or a check box in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-parent-id-of-radio-button-or-a-check-box/m-p/339588#M31452</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I found a solution to this problem and I am posting it here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var myElem = dojo.byId(myId) //provides access to the element itself&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myElem.parentNode //provides access to the "input" element in the example I provided&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myElem.parentNode.parentNode //provides access to the parent "td" element in the example&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myElem.parentNode.parentNode.parentNode //provides access to the parent "tr" element&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myElem.parentNode.parentNode.parentNode.id //provides the id of the parent "tr" node&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myElem.parentNode.parentNode.parentNode.getElementsByTagName("td") //provides access to all "td" child elements under the parent "tr" element&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can use this control to get the innerHTML of the first child element. The overall code is as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;function returnParentId(myId){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var myElem = dojo.byId(myId).parentNode.parentNode.parentNode.getElementsByTagName("td");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myIndValue = myElem[0].innerHTML;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return myIndValue;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope this is helpful.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Samir&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 May 2012 16:09:58 GMT</pubDate>
    <dc:creator>SamirGambhir</dc:creator>
    <dc:date>2012-05-29T16:09:58Z</dc:date>
    <item>
      <title>Getting parent id of radio button or a check box</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-parent-id-of-radio-button-or-a-check-box/m-p/339587#M31451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to get the parent id of the selected radio button or checked check box. I am using ArcGIS 10.0 with JavaScript API.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My button/check box are nested in a div. Is it possible to get the id of each level of parentNode?&amp;nbsp; e.g.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;div id"someDivId"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;table id="someTableId"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;tr id="someTRId"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;td id="someTDId"&amp;gt;myTd&amp;lt;/td&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;td&amp;gt;&amp;lt;input data-dojo-type="dijit.form.RadioButton" id="checkTDId" /&amp;gt;&amp;lt;/td&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/tr&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/table&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/div&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, once the radio button is selected, how do I get the id and/or the displayed value of the sibling td?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Samir&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 May 2012 15:39:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-parent-id-of-radio-button-or-a-check-box/m-p/339587#M31451</guid>
      <dc:creator>SamirGambhir</dc:creator>
      <dc:date>2012-05-09T15:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Getting parent id of radio button or a check box</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-parent-id-of-radio-button-or-a-check-box/m-p/339588#M31452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I found a solution to this problem and I am posting it here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var myElem = dojo.byId(myId) //provides access to the element itself&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myElem.parentNode //provides access to the "input" element in the example I provided&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myElem.parentNode.parentNode //provides access to the parent "td" element in the example&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myElem.parentNode.parentNode.parentNode //provides access to the parent "tr" element&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myElem.parentNode.parentNode.parentNode.id //provides the id of the parent "tr" node&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myElem.parentNode.parentNode.parentNode.getElementsByTagName("td") //provides access to all "td" child elements under the parent "tr" element&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can use this control to get the innerHTML of the first child element. The overall code is as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;function returnParentId(myId){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var myElem = dojo.byId(myId).parentNode.parentNode.parentNode.getElementsByTagName("td");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;myIndValue = myElem[0].innerHTML;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return myIndValue;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope this is helpful.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Samir&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2012 16:09:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/getting-parent-id-of-radio-button-or-a-check-box/m-p/339588#M31452</guid>
      <dc:creator>SamirGambhir</dc:creator>
      <dc:date>2012-05-29T16:09:58Z</dc:date>
    </item>
  </channel>
</rss>

