durandal

Where does Durandal router set page title

ε祈祈猫儿з 提交于 2019-12-23 20:15:24
问题 I am using Durandal for a very simple website. In all of my browser tabs the page title is coming up with "undefined|" appended to the front of the application's title. Where is Durandal getting and setting that value? pthalacker 回答1: Ultimately Durandal's router plugin is setting the document.title. https://github.com/dFiddle/dFiddle-1.2/blob/gh-pages/App/durandal/plugins/router.js#L254 onNavigationComplete: function (routeInfo, params, module) { if (app.title) { document.title = routeInfo

Long running load operations in durandal

主宰稳场 提交于 2019-12-23 09:27:09
问题 I'm trying to work out where the best place to run a long-running load operation is using Durandal. From what I can tell, the general recommendation for loading data is in the ViewModel's activate method, which is what I usually do - something like: viewModel.activate = function () { var loadPromise = myService.loadData(); return $.when(loadPromise).then(function (loadedData) { viewModel.data(data); }); }; I know that if I don't return the promise here, then there's usually problems with the

Tracking down optimizer issues in durandal.js

∥☆過路亽.° 提交于 2019-12-23 03:55:09
问题 I have a large application with a few hundred viewmodels but when I run the optimizer it doesn't combine them into the main-built.js, it just clears out the file. Is there any way to get the optimizer to give you more information on where it had an error? 回答1: Here are all the options available --mode Indicates whether the optimizer should only 'generate' the r.js config or actually 'build' the optimized JS application. Default value build --source The path to the folder which contains the

Routing issue in application using MVC/Durandal and located in IIS subfolder

余生颓废 提交于 2019-12-23 02:24:21
问题 I´m looking for a solution for my problem I mentioned in the title. First of all you need to know that I have two MVC applications published on an IIS. The first application is kind of a central management system so I set up a Site called "Management" in IIS. The second app is a MVC web shop embedded as application (subfolder) in Site "Management". For the shop I created an MVC application using durandal. Now it seems like I have a routing problem. When I enter the URL defined in Site

How to create “full page dialog” with DurandalJS

不羁的心 提交于 2019-12-22 10:48:43
问题 I'm trying to eliminate "css modal windows" (modal windows are not mobile device best friends) of a web client side application (SPA), built with DurandalJS version 2. I would like to convert the modal windows to full page dialogs. It would still be a dialog window but instead of superimpose the div over the current view, I would like to hide the current view (while keeping its state) and show the div containing the dialog (using the "entrance" transition if possible or a similar technique -

DurandalJS - Why are transitions not starting right away when a user navigates

跟風遠走 提交于 2019-12-22 08:53:41
问题 Could someone explain why the transitions (at least the default one - entrance) are not starting right away when a user clicks on a link (navigate) with Durandal? In other words, do we need two mechanisms (loader animation + transition) to indicate that there is an action underway (ex. ajax call inside the activate method). I'm sure there's a good reason, or maybe I just have to modify the entrance transition? 回答1: It seems like Durandal's transitions run once the activate function resolves.

Durandal dialog

本小妞迷上赌 提交于 2019-12-22 01:16:54
问题 Please help. I'm trying to create a knockout template for durandal's dialog plugin. Is there anyone who can give me a basic example for this. Below is my sample code. But I can't make it work.. (function (require) { var app = require('durandal/app'), unitofwork = require('services/unitofwork'), dialog = require('plugins/dialog'); var self = this; var uow = unitofwork.create(); var userlist = ko.observableArray(); var selecteduser = ko.observable(); ko.dialog = { // Defines a view model class

Pass data in DurandalJS to other view

余生长醉 提交于 2019-12-22 00:27:50
问题 I'm developing a SPA webapplication with DurandalJS , but I don't understand something. Let's say I have page 1 and 2 . On page 1 there is a modal that creates a entity in the database with BreezeJS and gives back a key (that was generated in the database). I want to pass this fetched key and then go to my second page, page 2. I know how I can do this when I put it in the url http://localhost:60312/#/page2?orderid=2&repairorder=2 But this is not the way for Durandal , or is it? A user can

KendoUI integration into Durandal JS

拟墨画扇 提交于 2019-12-21 17:39:48
问题 I'm building a phonegap application and plan to use Telerik's Kendo UI framework to generate the UI. Telerik Kendo UI already has an MVVM implementation and I'd like to use that and not include Knockout JS. Is this something that is supported, or is Durandal JS deeply integrated with Knockout? 回答1: Roger Gullhaug has written a blog post, detailing how Durandal can be used together with Kendo UI's data binding: Using Durandal and KendoUI together Also the official Durandal documentation

Durandal router / lifecycle events when using a childRouter

旧巷老猫 提交于 2019-12-21 16:55:31
问题 In a single page app built using Durandal, I have a settings view, with different sections. I use a childRouter to resolve the different sections. In this application, a lot of code hooks into the composition lifecycle events that Durandal uses. For example, this custom binding: ko.bindingHandlers.autoFocus = { init: function (element) { var $element = $(element), setFocus = function () { $element.focus(); }; router.on('router:navigation:composition-complete', setFocus); ko.utils