Mouse event and rest service

Discussion created by VinayBa on Aug 22, 2013
Latest reply on Aug 23, 2013 by svakil-esristaff
HI All,

  I saw this sample

  here population is displayed when we mouse hover a south calorina state, if i want to display something onclick , then its not happening , please help me understand this.i added following code but still no help.

 require(["dojo/on", "esri/symbols/SimpleFillSymbol", "esri/symbols/SimpleLineSymbol", "dojo/_base/Color", "esri/graphic"], function(on, SimpleFillSymbol, SimpleLineSymbol, Color, Graphic) {
                    on(southCarolinaCounties, "click", function(evt) {
                        // clears current selection
                        // create new graphic with selected graphic's geometry
                        var graphic = new Graphic(evt.graphic.geometry);
                        // create a new symbol for the graphic
                        var sfs = new SimpleFillSymbol(SimpleFillSymbol.STYLE_FORWARD_DIAGONAL, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255, 0, 0]), 2), new Color([255, 255, 0, 0.5]));
                        // add symbol to the graphic
                        // add the graphic to the map   

Do it depend on rest service that we are using whether we can add onclick funtionality or how does mous event work .Please guide.