mirror of
https://github.com/apache/superset.git
synced 2026-04-16 22:55:52 +00:00
[panoramix] -> [dashed]
This commit is contained in:
31
dashed/assets/visualizations/pivot_table.js
Normal file
31
dashed/assets/visualizations/pivot_table.js
Normal file
@@ -0,0 +1,31 @@
|
||||
var $ = window.$ = require('jquery');
|
||||
var jQuery = window.jQuery = $;
|
||||
|
||||
require('datatables');
|
||||
require('./pivot_table.css');
|
||||
require('../node_modules/datatables-bootstrap3-plugin/media/css/datatables-bootstrap3.css');
|
||||
|
||||
module.exports = function (slice) {
|
||||
var container = slice.container;
|
||||
var form_data = slice.data.form_data;
|
||||
|
||||
function refresh() {
|
||||
$.getJSON(slice.jsonEndpoint(), function (json) {
|
||||
container.html(json.data);
|
||||
if (form_data.groupby.length === 1) {
|
||||
var table = container.find('table').DataTable({
|
||||
paging: false,
|
||||
searching: false
|
||||
});
|
||||
table.column('-1').order('desc').draw();
|
||||
}
|
||||
slice.done(json);
|
||||
}).fail(function (xhr) {
|
||||
slice.error(xhr.responseText);
|
||||
});
|
||||
}
|
||||
return {
|
||||
render: refresh,
|
||||
resize: refresh
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user