1

I"m a newbie with the ASP .NET, a have an issue. I want to show up a feature table in a viewer but I don"t get any results.

I think I"m missing something?

Here is example that I took from the ArcGIS API example and include it in my project :

    <link rel="stylesheet" href="https://js.arcgis.com/3.20/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="https://js.arcgis.com/3.20/esri/css/esri.css">
<script src="https://js.arcgis.com/3.20/"></script>
<div>
    <p><em>The FeatureTable.</em></p>

    <div id="myTableNode"></div>
</div>
<style>

    #myTableNode {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
    }


</style>

<script>
    var map;

    require([
      "esri/layers/FeatureLayer",
      "esri/dijit/FeatureTable",
      "dojo/dom",
      "dojo/parser",
      "dojo/ready",
    ], function (
      FeatureLayer, FeatureTable,
      dom, parser, ready
    ) {

      parser.parse();

      ready(function(){

        // Create the feature layer
        var myFeatureLayer = new FeatureLayer("https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/New_Real_Estate/FeatureServer/0", {
          mode: FeatureLayer.MODE_ONDEMAND,
          outFields:  ["*"],
          visible: true,
          id: "fLayer"
        });

        var myFeatureTable = new FeatureTable({
            featureLayer: myFeatureLayer,
            showAttachments: true,
            // only allows selection from the table to the map
            syncSelection: true,
            zoomToSelection: true,
            gridOptions: {
              allowSelectAll: true,
              allowTextSelection: true,
            },
            editable: true,
            dateOptions: {
              // set date options at the feature table level
              // all date fields will adhere this
              datePattern: "MMMM d, y"
            },
            // define order of available fields. If the fields are not listed in 'outFields'
            // then they will not be available when the table starts.
            outFields: ["Address", "Created_Date", "Use_Type", "Building_Size_Sqft", 'Available_Size_Sqft',
              "Status", "Parking_Count", "Primary_Parking_Type", "Tenancy", "Floors"
            ],
            // use fieldInfos property to change field's label (column header),
            // the editability of the field, and to format how field values are displayed
            fieldInfos: [
              {
                name: 'Building_Size_Sqft',
                alias: 'Building Size',
                editable: false,
                format: {
                  template: "${value} sqft"
                }
              },
              {
                name: 'Available_Size_Sqft',
                alias: 'Available Size',
                format: {
                  template: "${value} sqft"
                }
              },
              {
                name: 'Primary_Parking_Type',
                format: {
                  template: "${value} parking"
                }
              }
            ],
          }, "myTableNode");

          myFeatureTable.startup();
      });
    });
</script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.