I am using this example to implement the editing on my map.
Editing Without Widget ARCGIS Javascript
The code employs a templatepicker which uses the layers on the map to show the features which can be selected and hence editing can be done on those features.
<SPAN class="pln" style="color: #000000;"> templatePicker </SPAN><SPAN class="pun" style="color: #145680;">=</SPAN><SPAN class="pln" style="color: #000000;"> </SPAN><SPAN class="kwd" style="color: #8a4a0b;">new</SPAN><SPAN class="pln" style="color: #000000;"> </SPAN><SPAN class="typ" style="color: #2b91af;">TemplatePicker</SPAN><SPAN class="pun" style="color: #145680;">({</SPAN><SPAN class="pln" style="color: #000000;"> featureLayers</SPAN><SPAN class="pun" style="color: #145680;">:</SPAN><SPAN class="pln" style="color: #000000;"> layers</SPAN><SPAN class="pun" style="color: #145680;">,</SPAN><SPAN class="pln" style="color: #000000;"> rows</SPAN><SPAN class="pun" style="color: #145680;">:</SPAN><SPAN class="pln" style="color: #000000;"> </SPAN><SPAN class="str" style="color: #800000;">"auto"</SPAN><SPAN class="pun" style="color: #145680;">,</SPAN><SPAN class="pln" style="color: #000000;"> columns</SPAN><SPAN class="pun" style="color: #145680;">:</SPAN><SPAN class="pln" style="color: #000000;"> </SPAN><SPAN class="lit" style="color: #953838;">2</SPAN><SPAN class="pun" style="color: #145680;">,</SPAN><SPAN class="pln" style="color: #000000;"> grouping</SPAN><SPAN class="pun" style="color: #145680;">:</SPAN><SPAN class="pln" style="color: #000000;"> </SPAN><SPAN class="kwd" style="color: #8a4a0b;">true</SPAN><SPAN class="pun" style="color: #145680;">,</SPAN><SPAN class="pln" style="color: #000000;"> style</SPAN><SPAN class="pun" style="color: #145680;">:</SPAN><SPAN class="pln" style="color: #000000;"> </SPAN><SPAN class="str" style="color: #800000;">"height: auto; overflow: auto;"</SPAN><SPAN class="pln" style="color: #000000;"> </SPAN><SPAN class="pun" style="color: #145680;">},</SPAN><SPAN class="pln" style="color: #000000;"> </SPAN><SPAN class="str" style="color: #800000;">"templatePickerDiv"</SPAN><SPAN class="pun" style="color: #145680;">);</SPAN>However, you have to select a feature yourself before starting to edit it. After selection, the selected feature is fetched as
<SPAN class="pln" style="color: #000000;">selectedTemplate </SPAN><SPAN class="pun" style="color: #145680;">=</SPAN><SPAN class="pln" style="color: #000000;"> templatePicker</SPAN><SPAN class="pun" style="color: #145680;">.</SPAN><SPAN class="pln" style="color: #000000;">getSelected</SPAN><SPAN class="pun" style="color: #145680;">();</SPAN>
This selectedTemplate is then selected to put the points on the map.
<SPAN class="pln" style="color: #000000;">selectedTemplate</SPAN><SPAN class="pun" style="color: #145680;">.</SPAN><SPAN class="pln" style="color: #000000;">featureLayer</SPAN><SPAN class="pun" style="color: #145680;">.</SPAN><SPAN class="pln" style="color: #000000;">applyEdits</SPAN><SPAN class="pun" style="color: #145680;">([</SPAN><SPAN class="pln" style="color: #000000;">newGraphic</SPAN><SPAN class="pun" style="color: #145680;">],</SPAN><SPAN class="pln" style="color: #000000;"> </SPAN><SPAN class="kwd" style="color: #8a4a0b;">null</SPAN><SPAN class="pun" style="color: #145680;">,</SPAN><SPAN class="pln" style="color: #000000;"> </SPAN><SPAN class="kwd" style="color: #8a4a0b;">null</SPAN><SPAN class="pun" style="color: #145680;">);</SPAN>
The problem is, I want to select the default or first feature in the templatePicker automatically as it loads. I tried finding if TemplatePicker has any method to select any feature but I couldnt. Is there any way that I could do that?