Is there any way to load a view into the DOM in a Kendo Mobile app without navigating to it so I can perform a validation on the view? For example, let's say I have two views "view1" and "view2" with "view1" being the view that is initially displayed. Both views have required input fields. Ideally, I would like to have a "Validate" button that performs validation on both views and displays a modal window listing the errors. For example:
var errors = [];
var view1Validator = $('#view1').kendoValidator().data("kendoValidator");
if (!view1Validator.validate()) {
errors = view1Validator.errors();
}
// unless the user has navigated to view2, it has not been loaded into the DOM, so view2Validator is always null
var view2Validator = $('#view2').kendoValidator().data("kendoValidator");
if (!view2Validator.validate()) {
errors = errors.concat(view2Validator.errors());
}
// display the errors
The problem is that unless I have already navigated to view2, it's not yet loaded into the DOM, so the view2Validator is always null.
Thanks,
Todd.