Has anyone implemented the javascript FeatureTable digit such that selections between it and the underlying featurelayer are synchronized?
Thanks much. Interesting. The form on(appTable, "dgrid-select", function(evt){ }); is in the example and works for you but does not work for me. I had to use the following: appTable.on("dgrid-select", function(evt){ });
Love an answer to your 2nd question if someone knows the answer - how to refresh a featuretable.
For your 1st question this worked for me. (sorry couldn't get it formatted correctly)
"featureLayer" : AppLayer,
"map" : map
}, 'divApps');
appTable.startup();
on(appTable, "dgrid-select", function(evt){
// fires when a row in the grid is clicked
AppLayer.selectFeatures(EditQuery, esri.layers.FeatureLayer.SELECTION_NEW, function (features) {
});
Thanks, that satisfies a portion of the need. Do you know how one would select a table row using the OBJECTID. Also, do you know how to refresh the featuretable after a new feature is added or an existing one is updated?
Not sure if you've had a chance to look at the Esri example - ArcGIS API for JavaScript Sandbox
There's an event "dgrid-select" to which you can attach, something like:
on(myTable, "dgrid-select", function(evt){
console.log("The dgrid-select event - ", evt);
In "evt", you can extract data from the selected row, e.g. evt[0].data.Cmn_Name, or maybe a unique identifier.
From here, I imagine you can apply a selection using that info, maybe something like:
Feature layer with selection | ArcGIS API for JavaScript
You could probably put your selection logic in the "dgrid-select" event - not sure if you need to do multiple selections, though. If so, you can probably work something out!
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.