test prevent error ordenar con elemento subtotales en lisa de atributos filas, agregar input checkbox para bandera mostrar subtotales
This commit is contained in:
parent
b3ad82be5a
commit
a35cbaa5f2
@ -573,16 +573,22 @@ var PivotTableUI = function (_React$PureComponent2) {
|
||||
}
|
||||
}, {
|
||||
key: 'makeDnDCell',
|
||||
value: function makeDnDCell(items, onChange, classes, headSlot) {
|
||||
value: function makeDnDCell(items, _onChange, classes, headSlot) {
|
||||
var _this7 = this;
|
||||
|
||||
var onChange = function onChange(newArr) {
|
||||
var _resultArr = newArr.filter(function (item) {
|
||||
return item !== '[:sub-total:]';
|
||||
});
|
||||
_onChange(_resultArr);
|
||||
};
|
||||
return _react2.default.createElement(
|
||||
_reactSortablejs2.default,
|
||||
{
|
||||
options: {
|
||||
group: 'shared',
|
||||
ghostClass: 'pvtPlaceholder',
|
||||
filter: '.pvtFilterBox',
|
||||
filter: '.pvtFilterBox, .pvtSubtotalCheck',
|
||||
preventOnFilter: false
|
||||
},
|
||||
tag: 'td',
|
||||
@ -734,23 +740,34 @@ var PivotTableUI = function (_React$PureComponent2) {
|
||||
var rowAttrs = this.props.rows.filter(function (e) {
|
||||
return !_this8.props.hiddenAttributes.includes(e) && !_this8.props.hiddenFromDragDrop.includes(e);
|
||||
});
|
||||
var toggleSubTotales = function toggleSubTotales() {
|
||||
var _showSubt = _this8.props.showSubtotales;
|
||||
_this8.propUpdater('rowOrder')(!_showSubt);
|
||||
};
|
||||
var renderCheckSubtotal = function renderCheckSubtotal() {
|
||||
return _react2.default.createElement(
|
||||
'li',
|
||||
{ className: 'pvtFilterBox', 'data-id': '[:sub-total:]' },
|
||||
{ className: 'pvtSubtotalCheck cursor-default', 'data-id': '[:sub-total:]' },
|
||||
_react2.default.createElement(
|
||||
'span',
|
||||
{ className: 'pvtAttr' },
|
||||
_react2.default.createElement(
|
||||
'span',
|
||||
{ className: 'pvtAttrTitle' },
|
||||
'Mostrar Subtotales S/N'
|
||||
)
|
||||
'Subtotales'
|
||||
),
|
||||
_react2.default.createElement('input', {
|
||||
type: 'checkbox',
|
||||
checked: _this8.props.showSubtotales,
|
||||
className: 'via-checkbox h-5 w-5 cursor-pointer',
|
||||
onChange: function onChange(e) {
|
||||
toggleSubTotales();
|
||||
}
|
||||
})
|
||||
)
|
||||
);
|
||||
};
|
||||
var rowAttrsCell = this.makeDnDCell(rowAttrs, this.propUpdater('rows'), 'pvtAxisContainer pvtVertList pvtRows', renderCheckSubtotal);
|
||||
console.log('render rowAttrs ', rowAttrs);
|
||||
var outputCell = _react2.default.createElement(
|
||||
'td',
|
||||
{ className: 'pvtOutput' },
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "v-react-pivottable",
|
||||
"version": "0.11.60",
|
||||
"version": "0.11.61",
|
||||
"description": "A React-based pivot table",
|
||||
"main": "PivotTableUI.js",
|
||||
"files": [
|
||||
|
Loading…
Reference in New Issue
Block a user