0

I'm new to NGX-datatable. I have to populate my data table from Firebase in my ionic app. Given below is the format of JSON which is returned from the Firebase.

I want to know if I don't use the User_id as a column, how do I access the User_id in the row button click event? Or in the other hand, how can I use the User_Id as a column how to hide User_Id column. How can I achieve this?

{
User_id:data,
User_name:data
}
Daniel
  • 2,355
  • 9
  • 23
  • 30
Thushara
  • 236
  • 3
  • 19

1 Answers1

1

You can find here on how to toggle columns in ngx-datatable

toggle(col) {
    const isChecked = this.isChecked(col);
    if(isChecked) {
      this.columns = this.columns.filter(c => { 
        return c.name !== col.name; 
      });
    } else {
      this.columns = [...this.columns, col];
    }
  }

GITHUB DEMO

Sajeetharan
  • 216,225
  • 63
  • 350
  • 396