AnsweredAssumed Answered

FeatureTable throws error editing when destroying and recreating

Question asked by dunkl1lm on Jan 22, 2018
Latest reply on Jan 22, 2018 by dunkl1lm

I have a feature table that I am trying to create multiple views for.  The only way that I've gotten this to work is to destroy the table and recreate it with new fieldInfos and outFields.  This updates the table with the right fields and edit states, but when I try to edit from within the table, I get an error saying that the update failed.  

// destroy the table if it exists already

var table = registry.byId("sitesTable");
if (table){
registry.remove("sitesTable");
}

// recreate the table with the same data source but different fieldList and fieldInfos

sitesTable = new FeatureTable({
"featureLayer": dataSource,
"hiddenFields" : layers[layerIndex].hiddenFields,
"map": map,
"editable":true,
"showGridMenu":false,
"gridOptions": {
allowTextSelection: true,
sort: {
field: sortField,
descending: true
}
},
"dateOptions":{
timeEnabled:false
},
"outFields": fieldList,
"fieldInfos": fieldInfos,
"syncSelection": true
}, 'sitesTable');

 

Any ideas why editing would fail?

Outcomes