durandal

Responsive Durandal dialog

末鹿安然 提交于 2019-11-30 10:11:46
I'm using Durandal in my new application and I have an issue with Durandal's dialog window (I'm using it to get some data from users). When I set width of window manually, (by default Durandal set window position from JavaScript) and if I want to have window width 600px , I need to do that through CSS with .dialog { width: 600px! important} . and that's where all the problems starts. On window resize, dialog is not responsive anymore, and when I have big form in it and window height is small, for example on laptops I cant see a half of my form and I don't get any scroll. On mobile devices it's

Durandal: Showing a 'LOADING…' during composition

寵の児 提交于 2019-11-30 07:07:05
I can easily show a loading message while the activate method is doing its thing like so: <div data-bind="compose:ActiveVm"> <div class="text-center" style="margin : 75px"> <i class="fa fa-spinner fa-spin"></i> </div> </div> However if I then update my ActiveVm property with a different viewmodel, the splash content does not show. I understand that the splash content is only designed to show on 'initial' load, but what options do I have for displaying such a message when transitioning from one viewmodel to another? Note that this composition does not participate in routing... Update: Related

How to handle / ignore a bad route with durandal?

孤人 提交于 2019-11-29 23:19:24
问题 I'm trying to conditionally block a route from being accessed. I think this can be done with guardRoute: http://durandaljs.com/documentation/Router/ function guardRoute(routeInfo, params, instance) : object - Before any route is activated, the guardRoute function is called. You can plug into this function to add custom logic to allow, deny or redirect based on the requested route. To allow, return true. To deny, return false. To redirect, return a string with the hash or url. You may also

ValidateAntiForgeryToken with SPA architecture

烈酒焚心 提交于 2019-11-29 22:40:41
I am trying to set Register and Login for Hot Towel SPA applicantion. I have created SimpleMembershipFilters and ValidateHttpAntiForgeryTokenAttribute based on the asp.net single page application template . How do you get the @Html.AntiForgeryToken() code to work in the Durandal SPA pattern. Currently I have a register.html <section> <h2 data-bind="text: title"></h2> <label>Firstname:</label><input data-bind="value: firstName" type="text" /> <label>Lastname:</label><input data-bind="value: lastName" type="text" /> <label>Email:</label><input data-bind="value: emailAddress" type="text" />

How to use partial views with Durandal.js, mvc3

北慕城南 提交于 2019-11-29 11:23:01
I noticed all of the views in the App/views folder are of type html, not cshtml. How do I use PartialViews and mvc3 things that I am accustomed to such as razor? Durandal is designed for creating an application that lives entirely inside of one page. The benifits of this is the user experience is that like of a desktop application. Also, this allows the application to easily be ported to phonegap where it can live as a native mobile application or even ported to a desktop application using appjs . By having your entire application as html, js, and css files you can compress/minify/uglify your

how to stop durandal / jquery stripping out script tags from views?

笑着哭i 提交于 2019-11-29 11:11:03
I know there are better patterns but in this case there's some legacy code that we'd like to move to a view. This html has a <script src="binding.js"></script> that needs to run after the page renders and displays. I hoped to do this with a <script src=""> tag, but the tag seems to be getting stripped out. How do we either get the script tag to render, or do a work-around with durandal? Example html: <div> <link rel="stylesheet" href="/Content/stylesheet1.css"/> <link rel="stylesheet" href="/Content/stylesheet2.css"/> <header> <h1>heading</h1> <h2>sub heading</h2> </header> <section> </section

Durandal 2.0 - Child routers intended for nested menus?

冷暖自知 提交于 2019-11-29 09:27:31
问题 I've building an app, and wanting to show a 2-tier menu, with both tiers always available. Durandal 2.0 introduced their new router, which supports 'child routers', which allow for easier deeplinking. My question - Can I have my 'child' navigation routes permanently loaded (and a sub menu rendered when the parent is not active), or is the 'child router' design intended to lazy-load them to evaluate them once a deeplink is to be evaluated? The Durandal examples show main navigation register a

Durandal.js: change navigation options per area

会有一股神秘感。 提交于 2019-11-29 02:30:47
I want to have different navigation per "area" of my durandal application. I've achieved this with ASP.NET MVC when using Areas by defining a Nav section in the layout page and having nested layout pages which implement the nav for each area. The view structure in durandal is as follows: http://i1346.photobucket.com/albums/p697/user2269352/viewstructure_zps5e21e724.gif I'm using the ASP.NET MVC4 durandal template and I am guessing that I might need to change the following segement from shell.html <ul class="nav" data-bind="foreach: router.visibleRoutes"> <li data-bind="css: { active: isActive

Durandal Subrouting (Hottowel)

那年仲夏 提交于 2019-11-28 17:40:00
Basically, I am trying to create a menu inside a menu. So, within a main menu route, there will be a vertical menu with another set of routes. When clicking on the submenu routes, only a part of the page gets updated, and the vertical menu does not reload. I am guessing it would be similar to this KO fiddle http://jsfiddle.net/dPCjM/ , but there would need to another set of "ghost" KO directives in a main route view: <!--ko compose: {model: router.activeItem, afterCompose: router.afterCompose, transition: 'entrance'} --> <!--/ko--> and some other configs on the durandal router... EDIT: And to

HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory

谁说胖子不能爱 提交于 2019-11-28 09:18:42
After finishing the John Papa course on Pluralsight- which is AWESOME by the way!!! ) I'm now creating my first SPA. I come from Desktop Application Developer background so excuse me if this question is newbie! When I load the SPA instead of seeing the splash screen and then the main screen I'm getting this error message: HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory.Most likely causes: A default document is not configured for the requested URL, and directory browsing is not enabled on the server. Can anyone help fix this? r pattanaik 1