I am upgrading from version 3.2 to 8.2.1. I read through the all the upgrade instructions and noticed that listeners were discouraged version 5.20. But I'm not finding a solution for how I previously used them. In this case when the user searches for a part #, they are able to press the down arrow and it moves them to the grid. And they can select from the filtered data. If they only have one result in the filtered data, they can press enter and it automatically moves to the grid and selects that item.
But neither of these are working now.
{title: "Part", width: 165, dataIndx: "Part", align: "left", cls: 'result',
filter: {
crules: [{condition: 'begin'}],
listener: [{'keydown': function (evt, ui) {
/* Custom filter listeners:
*
* if the down arrow is pressed the cursor will move to the first row in the grid
*
*/
if (evt.keyCode === 40) {
$("#inventory_grid").pqGrid("setSelection", {rowIndx: 0});
}
if (evt.keyCode === 13) {
/* if the enter key is pressed and there is only one row of data, the cursor will
* select the row and then use the data to open the edit form
*/
var data = $("#inventory_grid").pqGrid("pageData");
if (data.length === 1) {
$("#inventory_grid").pqGrid("setSelection", {rowIndx: 0});
var rowData = $("#inventory_grid").pqGrid("getRowData", {rowIndx: 0});
editpart(getpartarraybyinventoryid(rowData.InventoryID), 0);
}
}
}, 'keyup': function (evt, ui) {
/*
* This replicates the default search functions
*/
$("#inventory_grid").pqGrid("filter",
{
oper: 'replace',
data: [
{dataIndx: 'Part', condition: 'begin', value: ui.value}
]
}
);
}
}
]
}
},