williaster commented on a change in pull request #5707: [SIP-5] Refactor table
URL:
https://github.com/apache/incubator-superset/pull/5707#discussion_r214225356
##########
File path: superset/assets/src/visualizations/table.js
##########
@@ -196,14 +221,82 @@ function tableVis(slice, payload) {
sortBy = metrics[0];
}
if (sortBy) {
- datatable.column(data.columns.indexOf(sortBy)).order(fd.order_desc ?
'desc' : 'asc');
- }
- if (sortBy && metrics.indexOf(sortBy) < 0) {
- // Hiding the sortBy column if not in the metrics list
- datatable.column(data.columns.indexOf(sortBy)).visible(false);
+ const keys = columns.map(c => c.key);
+ const index = keys.indexOf(sortBy);
+ datatable.column(index).order(orderDesc ? 'desc' : 'asc');
+ if (metrics.indexOf(sortBy) < 0) {
+ // Hiding the sortBy column if not in the metrics list
+ datatable.column(index).visible(false);
+ }
}
datatable.draw();
- container.parents('.widget').find('.tooltip').remove();
+ $container.parents('.widget').find('.tooltip').remove();
Review comment:
I would guess that this tried to remove tooltips from other dashboard charts
🤔
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]