Thanks. This is at least a step further ;-)
But: I have some problems getting it to work.
Neither
reportTable = {
title: report.description,
editable: false,
maxWidth: '100%',
height: '100%',
flex: {
on: true,
one: true,
all: true
},
groupModel: {
on: true,
dataIndx: [],
merge: true,
grandSummary: true
},
showBottom: false,
resizable: true,
filterModel: {
on: true,
header: true,
},
toolbar: {
items: [
{
type: 'select',
label: '',
attr: 'id="export_format"',
options: [{xlsx: 'Excel', csv: 'Csv', htm: 'Html', json: 'Json'}]
},
{
type: 'button',
label: "Export",
icon: 'ui-icon-arrowthickstop-1-s',
listener: function () {
this.exportData({
url: "<?php echo $this->url( 'export' ) ?>",
format: $("#export_format").val(),
render: true
});
}
}]
}
};
createColModel = function () {
var colModelArray = [];
var alignReportData;
alignReportData = function () {
alignLeft = function (index) {
colModelArray.push(
{
filter: {
type: 'textbox',
condition: 'begin',
listeners: ['keyup']
},
title: reportHeadings[index],
align: "left"
}
)
};
alignRight = function (index) {
colModelArray.push(
{
filter: {
type: 'textbox',
condition: 'begin',
listeners: ['keyup']
},
title: reportHeadings[index],
align: "right",
format: '#.###,00',
dataType: "float",
summary: {
type: "sum"
}
}
)
};
$.each(dataArray[0], function (index, value) {
if (value === null || value.match(/^\D/)) {
alignLeft(index);
} else {
alignRight(index);
}
});
};
alignReportData();
return colModelArray;
};
reportTable.colModel = createColModel();
reportTable.dataModel = {
data: dataArray
};
};
}
and
reportTable = {
title: report.description,
editable: false,
maxWidth: '100%',
height: '100%',
flex: {
on: true,
one: true,
all: true
},
showBottom: false,
resizable: true,
filterModel: {
on: true,
header: true,
},
toolbar: {
items: [
{
type: 'select',
label: '',
attr: 'id="export_format"',
options: [{xlsx: 'Excel', csv: 'Csv', htm: 'Html', json: 'Json'}]
},
{
type: 'button',
label: "Export",
icon: 'ui-icon-arrowthickstop-1-s',
listener: function () {
this.exportData({
url: "<?php echo $this->url( 'export' ) ?>",
format: $("#export_format").val(),
render: true
});
}
}]
}
};
createColModel = function () {
var colModelArray = [];
var alignReportData;
alignReportData = function () {
alignLeft = function (index) {
colModelArray.push(
{
filter: {
type: 'textbox',
condition: 'begin',
listeners: ['keyup']
},
title: reportHeadings[index],
align: "left"
}
)
};
alignRight = function (index) {
colModelArray.push(
{
filter: {
type: 'textbox',
condition: 'begin',
listeners: ['keyup']
},
title: reportHeadings[index],
align: "right",
format: '#.###,00',
dataType: "float",
summary: {
type: "sum"
}
}
)
};
$.each(dataArray[0], function (index, value) {
if (value === null || value.match(/^\D/)) {
alignLeft(index);
} else {
alignRight(index);
}
});
};
alignReportData();
return colModelArray;
};
createGroupModel = function () {
var colModelArray = [];
$.each(dataArray[0], function (index, value) {
if (value === null || value.match(/^\d/)) {
colModelArray.push(
{
on: true,
dataIndx: [],
merge: false,
grandSummary: true,
}
)
}
});
return colModelArray;
};
reportTable.colModel = createColModel();
reportTable.groupModel = createGroupModel();
reportTable.dataModel = {
data: dataArray
};
};
}
work.
There is no additional line displayed at the bottom of the table.
I'm sure it (I) only need(s) a little tweaking/(hint).