Tried with the new functions showColumns/HideColumns. But seems like its only mentioned in the documentation. It throws error "TypeError: table1.hideColumns is not a function". I am using the BAW 20.0.0.1 version
If I use set and get columns on the table component then I also get error. Even if i don't change anything just call getColumns and setColumns and the table content also disappears.
Code-
var _this=this;
this.myShow=function(){
var table1= _this.ui.get('Table1');
var colSPec=table1.getColumns();
console.log("getColumns()--",colSPec);
table1.setColumns(colSPec);
table1.refresh(false);
}
Screenshot:-
------------------------------
Akash Gupta
------------------------------
Original Message:
Sent: Wed July 14, 2021 04:06 PM
From: Rackley Boren
Subject: How to use Badge in Service Data Table
Eric is correct. To add a few thoughts, the documentation for the Service Data table does not go into detail on rendering types, but the Table control does (see here). The documentation mentions the default for the Table control at least is to render as Coach View. So either IBM is going for parity between the two controls or there is a bug. I am leaning towards a bug there given the documentation doesn't mention it as noted earlier. If it is going for parity, I would like to see the same render as options for the Service Data Table instead of just the two currently there (Simple HTML and Custom), so we can explicitly set Coach View as the render as option in cases like this.
For Eric's suggestion of leaving out the Column definition in the Table's config options, the only way this works is if you have the badge as the last column in your table. If you were trying to have this as the first column, it wouldn't work. The Custom column rendering is the option I would probably go with here given what we are observing doesn't seem to be documented anywhere and you might run the risk of having to change your code if IBM changes the behavior.
You mentioned the reason behind going with the Service Data Table was updating column visibility. If you are just showing/hiding, you can use the showColumns and hideColumns, which look like newer functionality added to both the Table and Service data table as I don't recall seeing these functions in the past. If you need to swap read-only / visible, you can use the getColumns and setColumns.
------------------------------
Rackley Boren
Original Message:
Sent: Tue July 13, 2021 06:20 AM
From: Akash Gupta
Subject: How to use Badge in Service Data Table
I am trying to use a badge in service data table but it is not rendering. Is there is any way to show it in the rows. Each row will have different color on the badge.(For ex- 'Low' in Blue, 'Medium' in 'Yellow' and High in Red).
In the table control it is working fine but since I have update columns visibility on user actions therefore using service data table.
------------------------------
Akash Gupta
------------------------------