2
« on: February 24, 2016, 06:26:24 am »
Hi there,
We hit an issue in a multi row header setup when dynamically hiding/showing a column which is inside a multi row header definition. The top header disappears when hiding the column.
The issue can be easily reproduced by using the demo app sample: 'Pro->Columns->Show/Hide' an replace the original column definition (line 2 ff) with the following:
var columns = [
{ title: "Order ID", width: 100, dataIndx: "OrderID", hidden: true },
{title :"Header", colModel: [
{ title: "Customer Name", width: 130, dataIndx: "CustomerName" },
{ title: "Product Name", width: 190, dataIndx: "ProductName" },
{ title: "Unit Price", width: 100, dataIndx: "UnitPrice", align: "right" }]},
{ title: "Quantity", width: 100, dataIndx: "Quantity", align: "right" },
{title :"Header2", colModel: [{ title: "Order Date", width: 100, dataIndx: "OrderDate" },
{ title: "Required Date", width: 100, dataIndx: "RequiredDate", hidden: true },
{ title: "Shipped Date", width: 100, dataIndx: "ShippedDate", hidden: true },
{ title: "ShipCountry", width: 100, dataIndx: "ShipCountry", hidden: true },
{ title: "Freight", width: 100, align: "right", dataIndx: "Freight" },
{ title: "Shipping Name", width: 120, dataIndx: "ShipName" },
{ title: "Shipping Address", width: 180, dataIndx: "ShipAddress", hidden: true },
{ title: "Shipping City", width: 100, dataIndx: "ShipCity" },
{ title: "Shipping Region", width: 110, dataIndx: "ShipRegion", hidden: true },
{ title: "Shipping Postal Code", width: 160, dataIndx: "ShipPostalCode", hidden: true }]}
];
Then hide the column 'Order Date' and watch the top header 'Header 2' disappear (it should not) .
The following patch to 3.2.0 fixed our issue (only commented out the 'offending' lines )
Index: pages/scripts/grid/pqgrid.dev.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- pages/scripts/grid/pqgrid.dev.js (date 1455487520000)
+++ pages/scripts/grid/pqgrid.dev.js (date 1455577923000)
@@ -8297,15 +8297,15 @@
return
} else {
if (col > 0 && column == headerCells[row][col - 1]) {
- if (col > initH) {
- return
- } else {
+ //if (col > initH) {
+ // return
+ //} else {
var orig_colIndx = getColIndx(headerCells, row, column);
if (orig_colIndx < freezeCols) {
return
}
colSpan = colSpan - calcVisibleColumns(CM, orig_colIndx, col)
- }
+// }
} else {
if (freezeCols && (col < freezeCols) && (col + colSpan > freezeCols)) {
var colSpan1 = colSpan - calcVisibleColumns(CM, freezeCols, initH),
\ No newline at end of file
Could you please verify and/or fix more adequately.
Best regards and thanks in advance
S