JavaScript durandal.js confirmation box not able to return yes or no

i would like to add comfirmationbox in durandal.js

i wrote following to code , but it is not returning Yes or NO

define(['services/logger', 'durandal/plugins/router', 'durandal/app'], function (logger, router, app) {

if (app.showMessage('Are you sure you want to delete :' + titlename + '?', 'Delete Confirmation', ['Yes', 'No'])) {
                DeleteAchievement(self, obj.Soid)
            }
Answer:1

the showMessage method returns a promise, so your code should look like:

app.showMessage('Are you sure you want to delete :' + titlename + '?', 'Delete Confirmation', ['Yes', 'No']).then(function(dialogResult){
    if(dialogResult === "Yes"){
        //Your code
    }
});

You can get more info here: http://durandaljs.com/documentation/Showing-Message-Boxes-And-Modals/

Answer:2

I'm trying to do a CORS on ie9 using ie9proxy.html: <!DOCTYPE HTML> <script src="https://apiurl/Content/xdomain.min.js"></script> "xdomain: Timeout waiting on iframe socket" ...

I'm trying to do a CORS on ie9 using ie9proxy.html: <!DOCTYPE HTML> <script src="https://apiurl/Content/xdomain.min.js"></script> "xdomain: Timeout waiting on iframe socket" ...

i have a class called .content , this content has an attribute called .data-time, i want to hide all element where it has .content class with setTimeout() function, anybody can help me? HTML code : &...

i have a class called .content , this content has an attribute called .data-time, i want to hide all element where it has .content class with setTimeout() function, anybody can help me? HTML code : &...

  1. multiple settimeout jquery
  2. settimeout jquery multiple function

I.m using ChartJs for "doughnut-pie-chart". The default radius is much bigger than what I expect,. Is there and way to resize the radius width.? The documentatin part did not provide any info. $( ...

I.m using ChartJs for "doughnut-pie-chart". The default radius is much bigger than what I expect,. Is there and way to resize the radius width.? The documentatin part did not provide any info. $( ...

What I wan't to achieve is the page to scroll to a certain position when a button is pressed. I have this working on browsers like Chrome and IE but it doesn't seem to work on any mobile browser. ...

What I wan't to achieve is the page to scroll to a certain position when a button is pressed. I have this working on browsers like Chrome and IE but it doesn't seem to work on any mobile browser. ...

  1. animate scrolltop mobile
  2. animation scroll mobile
  3. jquery animate scroll mobile
  4. jquery animate scrolltop mobile