ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: Jignesh on November 20, 2019, 08:08:27 pm
-
Hi,
I have a problem for add/delete columns on context header.
I have set context-click event but not understand how to add/delete columns as
{
title: "Data", align: "center", colModel: [
{
title: "", width: 50, dataType: "bool", menuInDisable: true,
render: function (ui) {
var rowData = ui.rowData,
dataIndx = ui.dataIndx;
ldataIndx = 6;
rowData.pq_cellcls = rowData.pq_cellcls || {};
if (rowData["Skip"] == true) {
rowData.pq_cellcls[dataIndx] = 'grey';
rowData.pq_cellcls[ldataIndx] = 'grey';
return "<input type='checkbox' " + (ui.cellData ? "checked='checked'" : "") + " />";
}
else {
rowData.pq_cellcls[dataIndx] = '';
rowData.pq_cellcls[ldataIndx] = '';
return "<input type='checkbox' " + (ui.cellData ? "checked='checked'" : "") + " />";
}
},
align: "center", dataIndx: "Skip", exportRender: false, editor: false, type: 'checkbox', cls: 'hideRightborder'
},
{ title: "Opics Test", width: 170, dataType: "string", cls: 'hideLeftborder', filter: { crules: [{ condition: 'contain' }] } }]
},
formate with blank data.
Please give me some links or some possible way to achieve add/delete columns like MS Excel.
Thank you,
Jigneh
-
Jignesh
I've updated this demo to include Add / delete column functionality in header menu.
https://paramquery.com/pro/demos/context_menu
Hope it helps.
-
Thank you Paramvir,
Context add column successfully working.
But I have got an issue from Delete context columns: I have attached a screenshot.
A scenario like 1) I have added new 3 columns with different titles by context menu in the last column list.
2) I have tried to delete the second last column by context delete but columns have not deleted as display in screenshots.
3) But if I delete column as "OPICS_FX_SPOT_Purchase" yellow underline in a screenshot and delete then last column delete.
I have parent child columns structure like : Parent column title = "OPICS_FX_SPOT_Purchase"
Childs columns = 1) checkbox column with blank title
2) string column with data.
I have already given column structure in the first question in this thread.
Please give me help for resolve this scenario.
Thank you,
Jignesh
-
What's the issue. Please share a jsfiddle.
-
Can I show you by teamview or remote ?
-
Got it.
Previous code for Add/Delete columns was for non-grouped columns only.
Please refer to the updated script for grouped columns in this demo and adapt it to your needs:
https://paramquery.com/pro/demos/context_menu