FeaturesTable (Upgrade from 3.25 to 4.15) TypeError: Cannot read properties of undefined (reading 'title')

509
2
Jump to solution
04-27-2022 04:30 AM
utility9213
New Contributor III
Good day everyone, I have ran into an issue when I upgraded my api version from 3.25 to 4.15. It kept showing me "TypeError: Cannot read properties of undefined (reading 'title')". But this code works perfectly on 3.25 I had reviewed some of the changes and I am not sure what is wrong with this code.
 
 const featureTable = new FeatureTable({
          featureLayer: featureLayer,
          editable: true,
          syncSelection: true,
          dateOptions: {
            datePattern: 'dd/MM/y',
            timeEnabled: true,
            timePattern: 'HH:mm:ss',
          },
          hiddenFields: ["objectid", "objectid_1"],
          // use fieldInfos object to change field's label (column header),
          // change the editability of the field, and to format how field values are displayed
          // you will not be able to edit callnumber field in this example.
          fieldConfigs: [{
              name: 'question',
              alias: 'Question'
            },
            {
              name: 'answer',
              alias: 'Answer'
            },
            {
              name: 'created_user',
              alias: 'Created By',
              editable: false
            },
            {
              name: 'created_date',
              alias: 'Created Date',
              editable: false
            },
            {
              name: 'last_edited_user',
              alias: 'Modified By',
              editable: false
            },
            {
              name: 'last_edited_date',
              alias: 'Modified Date',
              editable: false
            },
            {
              name: 'status',
              alias: 'Status',
            }
          ], container: document.getElementById("tableNode")
        });
        featureTable.startup();
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

You're using properties in the constructor that have been changed for 4.23, such as featureLayer (use layer) and editable (use editingEnabled) and others that don't exist, like syncSelection, dateOptions, and hiddenFields. The method startup doesn't exist either. In the fieldConfigs, the properties are also changed, using label instead of alias

View solution in original post

2 Replies
KenBuja
MVP Esteemed Contributor

You're using properties in the constructor that have been changed for 4.23, such as featureLayer (use layer) and editable (use editingEnabled) and others that don't exist, like syncSelection, dateOptions, and hiddenFields. The method startup doesn't exist either. In the fieldConfigs, the properties are also changed, using label instead of alias

utility9213
New Contributor III

Thank you very much good sir! This worked, sorry I am new to this api.

0 Kudos