Search code examples
angular6ng2-smart-table

How to update column's property value in ng2-smart-table?


In ng2-smart-table I have a one setting like this.

name: {
    title: 'Name',        
    filter: true,
    addable: false
}

As you can see I have set addable false by default. Now in one case I have to make it true.

What I have tried:

Try 1:

this.settings.columns.name.addable = true;   

Try 2:

let newSettings = this.settings;
newSettings.columns.name.addable = true;
this.settings = Object.assign({}, newSettings);

This reset my other data too. :(


Solution

  • I have solved that issue by set a data in new object and pass it to resolve().

    let data;
    data['columnName'] = 'newData';
    event.confirm.resolve(data);
    

    It works for me. :)