Sachin Shah
Sachin Shah

Reputation: 4533

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. :(

Upvotes: 1

Views: 927

Answers (1)

Sachin Shah
Sachin Shah

Reputation: 4533

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. :)

Upvotes: 1

Related Questions