0
我希望表格内容在单元格中右对齐。我在AngularJS中使用pdfmake导出数据。UI Grid AngularJS:单元格过滤器重新对齐表格数据
当我将此过滤器应用于表格数据时,它左对齐表格数据。 这里是过滤器:
app.filter('rentalFilter', function() {
return function (value, scope) {
// Only perform logic if the value is actually defined
if(typeof value != 'undefined') {
if(value == null || value == "")
value = 0;
value = value.toFixed(2);
if(value >= 0) {
var parts=value.toString().split(".");
return parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",") + (parts[1] ? "." + parts[1] : "");
}
else {
value = value * -1.00;
value = value.toFixed(2);
var parts=value.toString().split(".");
return "-" + parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",") + (parts[1] ? "." + parts[1] : "");
}
}
};
});
没有这个过滤器,exporterPdfAlign: 'right'
对齐每列中的所有内容。
{
name : 'mondayNet',
displayName : 'Net',
category : "MONDAY",
exporterPdfAlign: 'right',
width : '14%',
cellTemplate : 'app/views/common/templates/cell/pos-neg-cell-template.html',
footerCellTemplate : '<div class="ui-grid-cell-contents text-center" ng-class="{positive : col.getAggregationValue() > 0, negative : col.getAggregationValue() < 1}">{{col.getAggregationValue() | number : 2}}</div>',
aggregationType : uiGridConstants.aggregationTypes.sum,
enableColumnMenu : false
},
如何在滤镜中应用正确的对齐方式?由于