agregar elementos vacios para el caso en que hay más de 2 campos en las agrupaciones de fila
This commit is contained in:
parent
540d3d4d51
commit
2e486233b5
@ -95,17 +95,22 @@ function makeRenderer() {
|
|||||||
var beforeFirstKey = null;
|
var beforeFirstKey = null;
|
||||||
for (var idx = 0; idx < rowKeys.length; idx++) {
|
for (var idx = 0; idx < rowKeys.length; idx++) {
|
||||||
var arrRowKeys = rowKeys[idx];
|
var arrRowKeys = rowKeys[idx];
|
||||||
|
var emptyElements = arrRowKeys.length - 2;
|
||||||
|
var arrEmptyElements = [];
|
||||||
|
for (var idxEmpt = 0; idxEmpt < emptyElements; idxEmpt++) {
|
||||||
|
arrEmptyElements.push('');
|
||||||
|
}
|
||||||
var currentFirstKey = arrRowKeys[0];
|
var currentFirstKey = arrRowKeys[0];
|
||||||
if (beforeFirstKey === null) {
|
if (beforeFirstKey === null) {
|
||||||
beforeFirstKey = currentFirstKey;
|
beforeFirstKey = currentFirstKey;
|
||||||
}
|
}
|
||||||
if (beforeFirstKey !== currentFirstKey) {
|
if (beforeFirstKey !== currentFirstKey) {
|
||||||
rowKeysSub.push([beforeFirstKey, '[:sub-total:]']);
|
rowKeysSub.push([beforeFirstKey].concat(arrEmptyElements, ['[:sub-total:]']));
|
||||||
beforeFirstKey = currentFirstKey;
|
beforeFirstKey = currentFirstKey;
|
||||||
}
|
}
|
||||||
rowKeysSub.push(arrRowKeys);
|
rowKeysSub.push(arrRowKeys);
|
||||||
if (idx === rowKeys.length - 1) {
|
if (idx === rowKeys.length - 1) {
|
||||||
rowKeysSub.push([currentFirstKey, '[:sub-total:]']);
|
rowKeysSub.push([currentFirstKey].concat(arrEmptyElements, ['[:sub-total:]']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "v-react-pivottable",
|
"name": "v-react-pivottable",
|
||||||
"version": "0.11.64",
|
"version": "0.11.65",
|
||||||
"description": "A React-based pivot table",
|
"description": "A React-based pivot table",
|
||||||
"main": "PivotTableUI.js",
|
"main": "PivotTableUI.js",
|
||||||
"files": [
|
"files": [
|
||||||
|
Loading…
Reference in New Issue
Block a user