简体   繁体   中英

Hide column in ngx-datatable Ionic

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
}

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM