1
votes

I have seen examples where you can autocomplete when filtering.

But how do you hook up to a Web API with autocomplete when you're adding a new record?

1
anyone ? or perhaps a suggestion for another datatable? - Noob

1 Answers

1
votes

I load the autocomplete-data before I set the settings of ng2-smart-table. After loading the data I set the settings with a column-definition like this:

this.settings = {
    columns: {
      business_role: {
        title: 'Business Role',
        editor: {
          type: 'completer',
          config: {
            completer: {
              data: this.dataBusinessRoles,
              searchFields: 'business_role',
              titleField: 'business_role'
            },
          },
        }
      }
  }
}