Hi,
Using non-MVVM the grid has the setOptions function. There is no equivalent in MVVM. I want to create options that are standard on every grid across every one of my pages without having to declare those options every time.
Things like filterable, sortable, etc. need to be the same across all of my grids and declaring data-sortable="true" on every page seems pointless and can lead to mistakes. How do I do this in MVVM? In non-MVVM I could just have a central function like this:
var setupStandardGridOptions = function(target) {
if (target) {
$(target).data("kendoGrid").setOptions({
navigatable: true,
filterable: true,
sortable: true,
resizable: true,
selectable: true,
pageable: {
pageSize: 20,
pageSizes: [20, 50, 100],
numeric: true
}
});
}
};
If I call this method in the init() of the view model it does not work. I can call it AFTER the view model is bound outside of the view model but any jquery like that for specific controls in the init() of the view model does no work. How do I set the options INSIDE the view model itself in either a single field or in a method during the init()?