0

I'm using the FeatureTable widget to add a table to map app that I built in the 3.17 JS API. As it's currently set up, the table loads more content as you scroll. My trouble is that my table has tens of thousands of records and the user could effectively be scrolling forever. Is there a way to paginate the table to something like 1000 records per page? Something that looks like the attached image? Can anyone point me to a sample that I can look at that accomplishes this or suggest a methodology?

enter image description here

require([
        "esri/map",
        "esri/layers/FeatureLayer",
        "esri/dijit/FeatureTable",
        "dojo/dom",
        "dojo/parser",
        "dojo/ready",
        "dojo/on"
    ], function (
        Map, FeatureLayer, FeatureTable, dom, parser, ready, on
    ) {
        parser.parse();

    var mapMain = new Map("mapDiv", {
            basemap: "topo",
            center:  [-121, 38],
        zoom: 6,
    showLabels: true
        });

        var myTableLayer = new FeatureLayer("https://data.farwestern.com/arcgis/rest/services/scratch/test_SD_RelatedResources/MapServer/2", {
    mode: FeatureLayer.MODE_ONDEMAND,
    visible: true,
    outFields: ["*"]
    });

        mapMain.addLayer(myTableLayer);

        myFeatureTable = new FeatureTable({
    featureLayer : myTableLayer,
    outFields:  ["*"],
    map : mapMain,
    gridOptions: {
        allowSelectAll: true,
        allowTextSelection: true,
        selectionMode: "extended"
    },
        syncSelection : false,
    }, 'tableDiv');

        myFeatureTable.startup();
    });
2

This is possible. See the pagination boolean and pageSizeOptions: https://developers.arcgis.com/javascript/3/jsapi/featuretable-amd.html#gridoptions

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.