forked from Techsystech/web
parent
b383356307
commit
9ad830d54c
|
@ -20,9 +20,16 @@ openerp.web_graph_sort = function(instance) {
|
||||||
draw_measure_row: function (measure_row) {
|
draw_measure_row: function (measure_row) {
|
||||||
var $row = $('<tr>').append('<th>');
|
var $row = $('<tr>').append('<th>');
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
var measures = _.unique(_.map(measure_row, function(cell){return cell.text;}));
|
||||||
|
var measure_index = _.indexBy(self.measure_list, 'string');
|
||||||
|
|
||||||
|
var first_total_index = measure_row.length - measures.length;
|
||||||
|
var column_index = 0;
|
||||||
|
|
||||||
_.each(measure_row, function (cell) {
|
_.each(measure_row, function (cell) {
|
||||||
_.each(self.measure_list,function(item){
|
var item = measure_index[cell.text];
|
||||||
if(item.string === cell.text) {
|
if(item){
|
||||||
var data_id;
|
var data_id;
|
||||||
if (
|
if (
|
||||||
self.pivot.sort !== null &&
|
self.pivot.sort !== null &&
|
||||||
|
@ -44,12 +51,17 @@ openerp.web_graph_sort = function(instance) {
|
||||||
if (cell.is_bold) {
|
if (cell.is_bold) {
|
||||||
$cell.css('font-weight', 'bold');
|
$cell.css('font-weight', 'bold');
|
||||||
}
|
}
|
||||||
if (self.pivot.sort !== null && self.pivot.sort[0].indexOf(item.field) >= 0) {
|
|
||||||
|
if (
|
||||||
|
column_index >= first_total_index &&
|
||||||
|
self.pivot.sort !== null &&
|
||||||
|
self.pivot.sort[0].indexOf(item.field) >= 0
|
||||||
|
) {
|
||||||
$cell.addClass((self.pivot.sort[0].indexOf('-') === -1) ? "sortdown": "sortup");
|
$cell.addClass((self.pivot.sort[0].indexOf('-') === -1) ? "sortdown": "sortup");
|
||||||
}
|
}
|
||||||
$row.append($cell);
|
column_index += 1;
|
||||||
}
|
}
|
||||||
});
|
$row.append($cell);
|
||||||
});
|
});
|
||||||
this.$thead.append($row);
|
this.$thead.append($row);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue