Is there a way to filter FeatureTable by attribute? I found similiar question but for version 3.x and it requires to implement custom input field for each column.
https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-it-possible-to-filter-the-feature-table/td-p/645957
Maybe version 4.x does support such functionality out of the box?
I created a widget to duplicate the functionalities of the filtering of the AT in WAB.
This is the main core of the widget. For the selected layer, I have a dropdown listing all fields and another dropdown for all values of the selected field where the user can create their SQLwhere statement. I hope it helps.
const getQuery = async (SQLwhere) => { let thelayer = theselectedlayer; let query = thelayer.createQuery(); query.where = SQLwhere; let thevalues = []; // query.orderByFields = selectedField; query.outFields = ["*"]; query.returnDistinctValues = false; query.returnGeometry = true; thelayer .queryFeatures(query) .then((results) => { console.log(results); if (results.features.length === 0) { document.getElementById("Message_html").innerHTML = "Query returned no features."; return; } if (featureTable) { featureTable.selectRows(results.features); }
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.