0

I am unable to show the durandal model in my application and i am sharing the code below. Please help me on this.

Model.js

    define(['plugins/dialog', 'knockout'], function(dialog, ko) {
        var model = function() {
            this.input = ko.observable('');
        };

        model.prototype.Ok = function () {
            dialog.close(this, this.input());
        };

        model.show = function () {
            return dialog.show(new model());
        };

        return model;
    });

model.html

<div>
    <table>
        <tr>
            <td> Serail No#</td>
            <td><input type="text" data-bind="value: input" /></td>
        </tr>
        <tr>
            <td>
                <input type="button" value="Ok" data-bind="click: Ok" />
            </td>
        </tr>
    </table>
</div>

calling method:

define(['./model'],function (demoModel){
 return {
          showmodel:function () {
                      demoModel.show();
                      //app.showDialog('./model');
            }
        };
});

i dont find any problem at code. any help is appreciate.

Thanks,
Siva

3
  • 1
    Any errors in console ? Nov 27, 2013 at 11:28
  • 1
    I don't see anything in the above code that looks to reference a Durandal modal, or at least where you are correctly implementing a custom modal. Have you looked at the docs at all yet? durandaljs.com/documentation/Showing-Message-Boxes-And-Modals
    – PW Kad
    Nov 27, 2013 at 13:58
  • i missed out the css class refernce. after adding the durandal css class, model popup is working fine.
    – Siva P
    Nov 28, 2013 at 6:00

1 Answer 1

0

I have got output after i do the below changes. Thank you all for your support.

define(['./model'],function (demoModel){
 return {
          showmodel:function () {
                      dialog.show(demoModel);
            }
        };
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.