ParamQuery grid support forum
General Category => Help for ParamQuery Grid (free version) => Topic started by: jeff_b on December 16, 2015, 11:18:04 pm
-
Hello,
I currently have a problem throughout my grid where if the user clicks in certain spots (marked in red in image) in the filtering row we are receiving a crash:
Unhandled exception at line 3109, column 4 in pqgrid.dev.js --- "JavaScript runtime error: dataIndx NA"
It is basically any where the filter is not occupying in the row with the filters. Some columns may not need a filter and clicking these areas causes the issues.
Note: This is a simplified version of the code from the demo.
(http://i.imgur.com/WyDSoG5.png)
<script>
$(function () {
var data = [[1, 'Exxon Mobil', '339,938.0', '36,130.0'],
[2, 'Wal-Mart Stores', '315,654.0', '11,231.0']];
var dataModel = {
location: "local",
sorting: "local",
sortIndx: "OrderID",
sortDir: "up"
}
var obj = {
width: 840, height: 460,
dataModel: dataModel,
wrap: false,
hwrap: false,
showBottom: false,
editable: false,
selectionModel: { type: 'cell' },
filterModel: { on: true, mode: "AND", header: true },
title: "Shipping Orders",
resizable: true,
columnBorders: true,
freezeCols: 2
};
obj.colModel = [
{ title: "Rank", width: 100, dataType: "integer" },
{ title: "Company", width: 200, dataType: "string",
filter: { type: 'textbox', condition: 'contain', listeners: ['keyup'], dataIndx: 'Company' }
},
{ title: "Revenues ($ millions)", width: 150, dataType: "float", align: "right" },
{ title: "Profits ($ millions)", width: 150, dataType: "float", align: "right" }
];
obj.dataModel = { data: data };
var $grid = $("#paged_grid").pqGrid(obj);
$grid.pqGrid("filter", { oper: 'add', data: [] })
.pqGrid("refresh");
});
</script>
-
dataModel.sortIndx doesn't match any of the dataIndx in colModel.
-
<script>
$(function () {
var data = [[1, 'Exxon Mobil', '339,938.0', '36,130.0'],
[2, 'Wal-Mart Stores', '315,654.0', '11,231.0']];
var dataModel = {
location: "local",
sorting: "local",
sortIndx: 'Company',
sortDir: "up"
}
var obj = {
width: 840, height: 460,
dataModel: dataModel,
wrap: false,
hwrap: false,
showBottom: false,
editable: false,
selectionModel: { type: 'cell' },
filterModel: { on: true, mode: "AND", header: true },
title: "Shipping Orders",
resizable: true,
columnBorders: true,
freezeCols: 2
};
obj.colModel = [
{ title: "Rank", width: 100, dataType: "integer" },
{ title: "Company", width: 200, dataType: "string",
filter: { type: 'textbox', condition: 'contain', listeners: ['keyup'], dataIndx: 'Company' }
},
{ title: "Revenues ($ millions)", width: 150, dataType: "float", align: "right" },
{ title: "Profits ($ millions)", width: 150, dataType: "float", align: "right" }
];
obj.dataModel = { data: data };
var $grid = $("#paged_grid").pqGrid(obj);
$grid.pqGrid("filter", { oper: 'add', data: [] })
.pqGrid("refresh");
});
</script>
I changed the sortIndx to match the dataIndx but am still getting the error (that was caused by the switch from all my live data to dummy data)
I should mention that the filter DOES work correct for the company name but I get the crash when I click any where red. (From original post)
Looks like the crash is in fn.getColIndx
Call Stack (all pqgrid.dev.js file)
fn.getColIndx (line 3109)
fc.scrollColumn (line 3562)
handlFocus (line 7399)
Is there a cdm for paramquery I can use for a jfiddle?
-
I tried looking at the demo from my second laptop (has never run this code)
went to paramquery.com/demos -> filter -> local header filtering
* I noticed all your text filters stretch across the entire column *
opened console and clicked the gray space under paid (not the check box the area next to the check box)
same error is logged into console.
This is with IE 9 on that machine IE 11 on my development machine
The same issue occurs in the remote filtering as well.
-
You are right, there is an error in IE when clicked in empty space beside filter input field.
I would look for a workaround or probably a fix in the next version.
-
Yikes!
Any idea on time frame / suggestions on work around?
My initial thought would be to catch the click and disregard it somehow but this is my first web project so not exactly sure.
-
Just wondering: Any update on a fix or suggestions on a work around?