.resultsGrid { } .resultsGrid .dgrid-cell { width: 100px; } .resultsGrid .dgrid-scroller { max-height: 200px; overflow: auto; position: relative; }
function populateNorthGrid() { // create query task var queryTaskNorth = new QueryTask(window.northParcelSched); // create query var queryNorthTable = new Query(); queryNorthTable.where = "1=1"; //SQL Query: use the field name like in the attribute table, and then the attibute you want to pull out //queryNorthTable.outFields = ["*"]; queryNorthTable.outFields = ["Date", "Event", 'OBJECTID']; queryNorthTable.spatialReference = new SpatialReference({wkid: 102100 }); // execute the query task // create an object that holds the data from table queryTaskNorth.execute(queryNorthTable, function(results) { var northTableData = array.map(results.features, function(feature) { return { // the fields in order as they are shown on the attribute table "dateField": feature.attributes.Date, "eventField": feature.attributes.Event, "id":feature.attributes.OBJECTID }; // return feature.attributes; }); // create new memory store to hold data // use tableData object to populate it // console.log(northTableData); var northMemoryStore = new Memory({ data: northTableData, idProperty:'OBJECTID' }); var northSchedGrid = new (declare([Grid, Selection]))({ bufferRows: Infinity, // make sure all rows from table show up columns: { //"id": "OBJECTID", "dateField": "Date", // specify the display names "eventField": "Event" }, store: northMemoryStore, class: 'resultsGrid' }, "northSchedGridDIV"); // northSchedGrid.set("store", northMemoryStore); northSchedGrid.startup(); }); }
queryNorthTable.spatialReference = new SpatialReference({wkid: 102100 });
var northMemoryStore = new Memory({ data: northTableData, idProperty:'OBJECTID' });
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.