I have a Grid created using a knockoutjs binding handler.
ko.bindingHandlers.jqxCassettesGrid = {
init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {
var values = valueAccessor();
var $element = $(element);
var source = {
localdata: values.source,
datafields: values.datafields,
datatype: "local",
id: 'ID'
};
var dataAdapter = new $.jqx.dataAdapter(source);
var options = {
showfilterrow: true,
filterable: true,
source: dataAdapter,
columns: values.columns,
};
// create the grid.
$element.jqxGrid(options);
}
};
(I have removed any redundant options and settings, but the error still exists)
The grid initially displays fine. source is bound to a knockout computed observable which is adjusted by clicking a button on the page. The grid works fine and the source changes appropriately, as long as there is no filter applied in the filter row. As soon as I try to enter filter criteria in the grid, I receive a “TypeError: Cannot read property ‘value’ of undefined” on the line “o = l.value;” in “_addfilterwidget”.
Is there anything I can do to avoid this error?