ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: darioup on September 21, 2018, 12:44:50 pm
-
Hi, I'm using the render function to make some customization on a column.
I'm also using the grouping feature to keep data more clear.
When the data is grouped it seems that the column with render function displays their "summary" option, which I don't declare in the colModel, and an undefined word is showed at the top of the table
How can I remove this "undeifned" word, or stop colModel with render function from being summarized?
(https://preview.ibb.co/gnz1ez/Screen_Shot_2018_09_21_at_1_50_08_AM.png)
Removing the grouping
(https://preview.ibb.co/j1eOsK/Screen_Shot_2018_09_21_at_1_50_22_AM.png)
colModel: [
{ title: "ID", "dataType": "integer", "dataIndx": "id",
editable: false, maxWidth: 50, align: 'center', denyGroup: true, },
{ title: "Nombre", dataType: "string", dataIndx: "name",
editable: false, width: 150 },
{ title: "Material", dataType: "string", dataIndx: "material",
editable: false, },
{ title: "Color", dataType: "string", editable: false, dataIndx: "color",
render: function (ui) {
var html = "";
if (ui.rowData.color_value) {
html += '<div class="color-sq" style="background-color:'+ ui.rowData.color_value +'"></div>';
}
html += "<span>"+ ui.rowData.color +"</span>";
return {
text: html
}
}
},
{ title: "TamaƱo", dataType: "string", dataIndx: "size",
editable: false, },
{ title: "Stock", dataType: "integer", dataIndx: "quantity",
maxWidth: 80, align: 'center', denyGroup: true,
summary: { type: "sum" },
render: function (ui) {
return {
style: 'background-color: rgb(76, 175, 80);color: white;border:1px dotted #333333;border-top:0;'
}
}
},
],
groupModel: {
on: true,
dataIndx: ['name'],
collapsed: [true],
fixCols: false,
summaryInTitleRow: 'all',
titleInFirstCol: false,
headerMenu: false,
}
-
If undefined is returned as text value by your render function, then it displays undefined.
html += "<span>"+ ui.rowData.color +"</span>";
Try changing it to
html += "<span>"+ (ui.rowData.color || "") +"</span>";
Please let me know whether it fix your issue, if not then kindly share a jsfiddle.
-
thanks it solved :)