4 thoughts on “About

  1. @LeLong37
    Hi Le Long!

    I read your msdn magical post http://msdn.microsoft.com/ru-ru/magazine/dn605877.aspx
    This is a very cool article!

    I need to use kendo notication and validator in the accountViewModel on Login.chtml.
    I do not know how pass an notification and validator instances to the viewModel.

    Login.chtml:

      User
    
    
    
    
      User
    
    
    
    
      Login
    

    loginViewModel.js

    define(['kendo'],
    function (kendo) {
    var loginViewModel = new kendo.data.ObservableObject({
    username: ‘input username…’,
    password: ”,
    validator: {},
    notification: {},
    onClick: function () {
    if (this.validator.validate())
    $(‘#login-form’).submit();
    else
    this.notification.show({ message: ‘Please insert username and password fields’ });
    }
    });
    return loginViewModel;
    });

    router.js


    router.route(‘/account/login’,
    function() {
    require(['loginViewModel', 'text!/account/login'],
    function (viewModel, view,
    // delegate after binding completed…
    function() {
    var notification = $(‘#notification’).kendoNotification({
    position: { pinned: true, top: 200, right: 100 },
    autoHide: 3000).data(‘kendoNotofication’);

           var validator = $('#login-form').kendoValidator().data('kendoValidator');
    
           kendo.bind($('#login-form'), viewModel);
    
           viewModel.set('notification', notification); // -> raise error: parent() undefined
           viewModel.set('validator ', validator ); // -> raise error: parent() undefined
       })
    })
    

    });

    Thank you for any ideas

    Like

    • Hi Alexander, if needed, you can click on my Codementor badge on the right column of this blog, I can review your implementation.

      Like

Please Leave a Reply or Tweet me @LeLong37...!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s