Member
177 Points
629 Posts
Jul 16, 2019 04:33 AM|neoaguil17|LINK
Hi
I integrated knockout .. sammy.js with ASPNET MVC, but I see that sometimes the routes are very slow,,,
I created routes as:
this.get('#EmpresasCer', function () { self.GoToModule({ viewName: 'EmpresaCer/EmpresaCerBusqueda', viewModelName: 'EmpresaCerBusqueda', replaceLast: true }); });
And they call the function..
self.GoToModule = function (moduleInfo) { if (typeof tinyMCE !== 'undefined') { tinyMCE.remove(); } var focusTab = function (tabId) { ko.utils.arrayForEach(self.ApplicationTabs(), function (val) { val.Activo(val.TabId === tabId); }); }; var setTab = function () { var fullViewUrl = setAjaxUrl(moduleInfo.viewName); require(['knockout', 'text!' + fullViewUrl, moduleInfo.viewModelName], function (ko, text, viewModel) { var $html = $(text); ko.applyBindings(new viewModel(moduleInfo.params), $html[0]); var newId = createUUID(); self.ApplicationTabs.push({ TabId: newId, ViewName: moduleInfo.ViewName, ViewModelName: moduleInfo.viewModelName, ReplaceLast: moduleInfo.replaceLast, PromptExit: moduleInfo.promptExit, Activo: ko.observable(true) }); if (moduleInfo.promptExit) { setLocalStorageVariable("KeepCurrentPage", "true"); } $('#' + newId).html($html); focusTab(newId); }, setRequireError); }; var currentTab = ko.utils.arrayFirst(self.ApplicationTabs(), function (val) { return val.ViewModelName === moduleInfo.viewModelName; }); if (currentTab !== null) { if (moduleInfo.replaceLast) { self.ApplicationTabs.remove(currentTab); setTab(); } focusTab(currentTab.TabId); } else { setTab(); } //content.setPage(viewModelName, viewName, params); };
I dont' understand why sometimes... when I click in the link:::
<a href="#" title="Directorio Empresa" data-bind="click: GotToHash.bind($data, 'EmpresasCer', null)">Directorio Empresa</a>
It can not find the route..
Member
177 Points
629 Posts
Sammy.js with AspNet MVC is slow
Jul 16, 2019 04:33 AM|neoaguil17|LINK
Hi
I integrated knockout .. sammy.js with ASPNET MVC, but I see that sometimes the routes are very slow,,,
I created routes as:
And they call the function..
I dont' understand why sometimes... when I click in the link:::
It can not find the route..