durandal

Adding click binding to existing view/viewmodel in Durandal/knockout

冷暖自知 提交于 2019-12-12 04:42:56
问题 I'm using a third party charting tool that generates a legend and in that legend I'm making the labels clickable. It uses a callback function to generate the label function legendLabelFormatter(label, series) { var linkHTML = '<a href="#" data-bind="click: drillDown(' + seriesIndex + '), clickBubble: false;">' + label + '</a>'; seriesIndex += 1; return linkHTML; } Obviously as the above labelFormatter function is activated after binding as a result of actions the user takes, the link binding

how to avoid run code twice using ko property

天大地大妈咪最大 提交于 2019-12-12 04:35:05
问题 I am creating a list page where there are two datepicker and one table. The idea of the page it's load the page with some registration data using default parameters for the datepickers, after that the user will be able to choose what he want to see according to the datepicker filters. To run my app I have created two properties fromDate and toDate and i am using suscribe method in order to know when the dates are changed, so that when the dates are changed i should call to my services (or

activationData not getting passed in durandal

送分小仙女□ 提交于 2019-12-12 04:13:07
问题 I am using durandal version 1.1. From compose binding I am passing some extra parameters through activationData. But the child viewmodel does not get the value. It is always received as undefined in the activate method. <div data-bind="compose: { model: 'testmodel', activationData: {data : 10}, activate: true }"> </div> The activate method looks like: define(['durandal/app', 'durandal/system', 'durandal/plugins/router', 'services/logger', 'services/datacontext', 'config'], function (app,

cacheViews:true until logout?

主宰稳场 提交于 2019-12-12 01:05:47
问题 I like using cacheViews:true in my application... I've made a SPA app with logout/login. Some views I have them render different views based on whether or not the current user is an administrator using the 'viewUrl' (HotTowel Durandal Inject different views based on the user) The problem I'm having is that if you logout of an administrator account and into a normal user account all the previous views are cached so as you navigate around it brings up all the admin views (the different

BreezeJS Selecting ComplexType properties

北城余情 提交于 2019-12-12 00:35:13
问题 I am running into an issue with Breeze and Durandal which is leading me to believe it may be a bug with Breeze or that I don't know the right syntax. Here is my model (given that Address is just a simple ComplexType class) public class Person { public int Id {get;set;} public string Name {get;set;} public Address MyAddress {get;set;} } And on the front-end with Breeze JS, I have the following: EntityQuery.from('Person').select('id,name').orderBy('id'); The above line works perfect, but if I

some java script seems to be overwritten by durandal

自闭症网瘾萝莉.ら 提交于 2019-12-11 21:08:10
问题 I am trying to implement a Single Page Application using the Hot Towel Template. Everything was fine until I tried to incorporate a CSS HTML template. I am using Durandal + RequireJS. My HTML for navigation bar is in nav.cshtml (I am using cshtml with Durandal) The same HTML if pasted in index.html before <div id="applicationHost"> it works fine. if Same is included inside applicationHost using Durandal nav view, it doesnt works properly. My nav.cshtml has one root and no spaces or comments.

running Javascript inside Durandal view

五迷三道 提交于 2019-12-11 19:44:58
问题 I am building a demo to use Durandal to work with D3.js. I modified on the Starter Kit. It has two views: Welcome and Flickr. I added a new view Chart and copied some d3js visualization javascript code inside my view: <section> chart demo <link type="text/css" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> //more scripts <div id="container" style=

Adding an entity to the Breeze saveMap which comes from DB (not a totally new entity)

让人想犯罪 __ 提交于 2019-12-11 19:27:05
问题 I use Breeze in my asp.net application with the Durandal SPA template. I need to add an entity to the saveMap which already exists in DB. Let's take this simple example: the page display an invoice and the invoice's lines. The user add a new invoice's line and click the save button. The SaveChanges controller's action is triggered with ONLY the modified invoice's line. Server side, the total is recalculated and the invoice's total must be modified. But this total is located on the invoice

Route and subroute based on user in hottowel asp.net mvc4

你说的曾经没有我的故事 提交于 2019-12-11 15:08:28
问题 :updated can anyone help me found out how to create routes and subroute based on user is it possible to create a Widget that will do the job if so how this is how my menu looks like (note:all menu items together let us call it master ): -Home -shop -men -women -food -dog -human -cart -settings -user -images -themes let say i have the following userGroup: -Admin -visitors -vip -costumers -co-workers what i want to do ist some thing like if(user == Admin){ destroy the current menu then make a

Single Page Application and Inline Fancybox not working properly

不问归期 提交于 2019-12-11 15:03:34
问题 I'm trying to make a SPA and use the Hot Towel template with durandal. So far I have succesfully added a Fancybox to my spa and it shows a image <a class="fancybox-thumb" rel="fancybox-thumb" href="http://farm9.staticflickr.com/8486/8225588056_d229e8fe57_b.jpg" title="Porth Nanven (MarcElliott)"> <img src="IMAGEPATH" alt="" /> </a> $(document).ready(function () { $(".fancybox-thumb").fancybox({ openEffect: 'elastic', closeEffect: 'elastic', helper: { title: { type: 'outside' }, thumbs: {