Filtering the Feature Table

200
0
03-13-2020 03:52 AM
NovicaJosifovski
New Contributor III

var featureTableLayer = new FeatureLayer("http://62.162.125.221/arcgis/rest/services/SiteOpstini_FS/FeatureServer/1", {
mode: FeatureLayer.MODE_ONDEMAND,
showLabels: true,
visible: true,
syncSelection: true,
zoomToSelection: true,
outFields: [
"objectid", "mesto_sifra", "mesto_ime", "ulica_ime", "ime_na_ulica_opstina", "novo_ime_na_ulica", "zabeleska_opstina", "greska_grafika"
],
id: "streetsLayer"
});
featureTableLayer.setDefinitionExpression("mesto_sifra = '" + nasMesto + "'");
map.addLayers([featureTableLayer]);

var myFeatureTable = new FeatureTable({
featureLayer: featureTableLayer,
syncSelection: true,
zoomToSelection: true,
editable: true,
outFields: [
"objectid", "mesto_sifra", "mesto_ime", "ulici_cr_fk", "ime_na_ulica_opstina", "novo_ime_na_ulica", "zabeleska_opstina", "greska_grafika"
],
hiddenFields: ["objectid"], // field that end-user can show, but is hidden on startup
fieldInfos: [
{
name: 'mesto_sifra',
alias: 'Шифра на населено место',
editable: false
},
{
name: 'mesto_ime',
alias: 'Име на населено место',
editable: false
},
{
name: 'ulici_cr_fk',
alias: 'Име на улица',
editable: false
},
{
name: 'ime_na_ulica_opstina',
alias: 'Име на улица (општина)',
editable: false,
format: {
template: "<button>Hello</button>", //put content before and after the wildcard
}
},
{
name: 'novo_ime_na_ulica',
alias: 'Ново име на улица',
editable: true
},
{
name: 'zabeleska_opstina',
alias: 'Забелешка (општина)',
editable: true
},
{
name: 'greska_grafika',
alias: 'Грешка во графика',
editable: true
}

],
"map": map
}, 'myTableNode');

myFeatureTable.filterSelectedRecords(true);
myFeatureTable.startup();

I want to filter the Feature table is possible. I have a column with street name but there are several streets with the same name. Can I somehow, filter them? I only need it to show the street once. 

Tags (1)
0 Kudos
0 Replies