Hi,
I have the following issue: We're creating a simple Employee Lookup app where you can drill down from the employee details to the manager details and direct reports details. Each of these pages essentially look the same so I would like to use the same view.
Here my issue:
- When I am on a view 'employee-detail-view' and then want to navigate to the same view again (for manager or direct reports), KendoUI doesn't do this because it keeps track of which view it is currently on.
- I also tried inserting dynamic views into the DOM based on user navigation but it seems KendoUI can't find them. It appears it finds all the local views at beginning of app creation and then doesn't find the dynamically created ones. The code below shows a 'failed to locate resource' error since KendoUI is looking for an external html file.
Can anyone point me to the right approach?
Thanks!
m.navigateEmployeeDetailView = function(empId) {
// Forward Navigation
m.navFlag = true;
// Set Employee GUID
m.selectedEmployeeId = empId;
m.currentViewId = new Date().getTime();
var viewId = "m-emp-detail-view-"+m.currentViewId;
console.log('view id: '+viewId);
var newViewDiv = '<div id="'+viewId+'" data-role="view" data-title="Details" data-before-show="m.showEmployeeDetailView" style="display:none;"></div>';
// Add it to the container
$('#m-emp-detail-views').append(newViewDiv);
// Add Template
var template = kendo.template($("#m-emp-detail-templ").html());
var data = { empId: m.currentViewId };
// Pass data to the template
var result = template(data);
$('#'+viewId).html(result);
// Navigate to view
m.kendoApp.navigate(viewId);
I have the following issue: We're creating a simple Employee Lookup app where you can drill down from the employee details to the manager details and direct reports details. Each of these pages essentially look the same so I would like to use the same view.
Here my issue:
- When I am on a view 'employee-detail-view' and then want to navigate to the same view again (for manager or direct reports), KendoUI doesn't do this because it keeps track of which view it is currently on.
- I also tried inserting dynamic views into the DOM based on user navigation but it seems KendoUI can't find them. It appears it finds all the local views at beginning of app creation and then doesn't find the dynamically created ones. The code below shows a 'failed to locate resource' error since KendoUI is looking for an external html file.
Can anyone point me to the right approach?
Thanks!
m.navigateEmployeeDetailView = function(empId) {
// Forward Navigation
m.navFlag = true;
// Set Employee GUID
m.selectedEmployeeId = empId;
m.currentViewId = new Date().getTime();
var viewId = "m-emp-detail-view-"+m.currentViewId;
console.log('view id: '+viewId);
var newViewDiv = '<div id="'+viewId+'" data-role="view" data-title="Details" data-before-show="m.showEmployeeDetailView" style="display:none;"></div>';
// Add it to the container
$('#m-emp-detail-views').append(newViewDiv);
// Add Template
var template = kendo.template($("#m-emp-detail-templ").html());
var data = { empId: m.currentViewId };
// Pass data to the template
var result = template(data);
$('#'+viewId).html(result);
// Navigate to view
m.kendoApp.navigate(viewId);