ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: STEVE on July 09, 2022, 06:28:09 am
-
Dear paramvir,
I want to know how to prevent this html tag when I export excel file?
In downloaded excel file, it has this like <button type='button' class='delete_btn'>Delete</button>
Best regards,
Steve.
-
it can be prevented by adding exportRender: false to the column.
https://paramquery.com/pro/api#option-column-exportRender
-
I put it after sortable: false.
But it didn't work at all.
title: "", editable: false, minWidth: 83, sortable: false, exportRender: false,
render: function (ui) {
return "<button type='button' class='delete_btn'>Delete</button>";
},
postRender: function (ui) {
var rowIndx = ui.rowIndx,
grid = this,
$cell = grid.getCell(ui);
$cell.find("button").button({ icons: { primary: 'ui-icon-scissors' } })
.bind("click", function () {
grid.addClass({ rowIndx: ui.rowIndx, cls: 'pq-row-delete' });
setTimeout(function () {
var ans = window.confirm("Are you sure to delete row No " + (rowIndx + 1) + "?");
grid.removeClass({ rowIndx: rowIndx, cls: 'pq-row-delete' });
if (ans) {
grid.deleteRow({ rowIndx: rowIndx });
}
})
});
}
-
It works fine, can be verified by adding this in the toolbar of this example: https://paramquery.com/pro/demos/editing_batch
{
type: 'button',
label: "Export",
icon: 'ui-icon-arrowthickstop-1-s',
listener: function () {
this.exportData({
url: "/pro/demos/exportData",
format: "xlsx",
render: true
});
}
},
and adding exportRender: false, to the last column.
Which version of pqgrid you have been using?