Select to view content in your preferred language

Call attribute tables automatically

972
3
08-21-2012 02:31 AM
BarraLoubna
New Contributor
hello everyone,

I developed an application with silverlight "xaml" and "c #" and I noticed that the appearance of the features layer is very heavy, so I decided to develop an application in Javascript to see if there is a difference and to see if the features layers appear faster.

In silverlight application, I could call the attribute tables from the LIBRARY <esri:featuredatagrid.../>, is there a way to automatically call the attribute tables of layers in Javascript in the browser, because I noticed that it must specify the fields and draw pictures ...

Please help me, I'm stuck and I don't know what to do, especially I'm debutante in Javascript and I had never worked or study the Javascript before.

Please, help me, if you have examples ou codes....

Thank you.
0 Kudos
3 Replies
__Rich_
Regular Contributor
No previous JS experience?

In at the deep end then:

FeatureLayer Samples

HTH

🙂
0 Kudos
BarraLoubna
New Contributor
Thank you very much for your reply,

But I still have a question, is it possible to call the attribute tables of several layers in the same grid ...

I will test the examples you sent me and I'll come back to you if you allow ....

Thank you very much.

Loubna
0 Kudos
BarraLoubna
New Contributor
Hello,

I tried the example below,it works, but it doesn't work when I use my Feature Layer and layer my fields:

"http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/fl_dgrid.html".

This is my code :



function (Grid, Selection, Memory, Map, FeatureLayer, declare, dojoNum, parser) {
          // call the parser to create the dijit layout dijits
          parser.parse();

          // create the dgrid
          window.grid = new (declare([Grid, Selection]))({
              // use Infinity so that all data is available in the grid
              bufferRows: Infinity,
              columns: {
                  "FID": "FID",
                  "Shape": "Shape",
                  "Espace": { "label": "Espace", "formatter": dojoNum.format },
                  "Sum_Km_car": { "label": "Sum_Km_car", "formatter": dojoNum.format },
                  "Perimetre": { "label": "Perimetre", "formatter": dojoNum.format }
              }
          }, "grid");
          // add a click listener on the ID column
          grid.on(".field-id:click", selectState);

          window.map = new esri.Map("map", {
              "extent": new esri.geometry.Extent({ "xmin": -17121893, "ymin": 4021198, "xmax": -5459437, "ymax": 6594374, "spatialReference": { "wkid": 102100} }),
              "wrapAround180": true
          });
          map.addLayer(new esri.layers.ArcGISTiledMapServiceLayer("http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer"));

          window.statesUrl = "http://romulus/ArcGIS/rest/services/Monde/MapServer/1";
          window.outFields = ["*"];

          var fl = new FeatureLayer(window.statesUrl, {
              "id": "states",
              mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
              outFields: ["*"]

          });
          dojo.connect(fl, "onLoad", function (fl) {
              fl.maxScale = 0; // show the states layer at all scales
              fl.setSelectionSymbol(new esri.symbol.SimpleFillSymbol().setOutline(null).setColor("#AEC7E3"));
          });
          dojo.connect(fl, "onClick", selectGrid);
          map.addLayer(fl);

          dojo.connect(map, "onLoad", function (map) {
              //resize the map when the browser resizes
              dojo.connect(dijit.byId("map"), "resize", map, map.resize);
              // show the border container now that the dijits 
              // are rendered and the map has loaded
              dojo.style(dijit.byId("container").domNode, "visibility", "visible");
              populateGrid(Memory); // pass a reference to the MemoryStore constructor
          });
      }
    );



Please, could someone tell me where is the mistake ...

Thank you.

Loubna
0 Kudos