use angular ngDisable with kendo mobile

5 posts, 0 answers
  1. Naomi
    Naomi avatar
    6 posts
    Member since:
    May 2015

    Posted 17 May 2015 Link to this post

    I'm try use ng-disable in angular + kendo mobile but it is not work for me.

    I try this code: 

    <kendo-mobile-button id="buy-now" ng-disabled="isPlaceOrderEnable()" ng-click="menu.addToCart(kendoEvent)">Place Order</kendo-mobile-button>

    the 'isPlaceOrderEnable' function defined in the controller and return true/false.

    but the button is always enebled.

    Thanks in advance.

    Naomi.

  2. Martin Yankov
    Admin
    Martin Yankov avatar
    177 posts

    Posted 20 May 2015 Link to this post

    Hello Naomi,

    I have tested this in the Kendo UI Dojo and here is the result - http://dojo.telerik.com/imANA. I have tested both the ng-disabled and the k-enable directives and they both work as expected. Perhaps there is something else in your project that is failing.

    Let me know your thoughts.

    Regards,
    Martin Yankov
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
  3. Jeremy
    Jeremy avatar
    2 posts
    Member since:
    Mar 2015

    Posted 01 Sep 2015 in reply to Martin Yankov Link to this post

    I cannot get this work either. 

    Tried, ng-enabled/ng-disabled, k-ng-enabled/disabled, disabled, ect .....and the only one that worked was disabled, but only at load. 

     

  4. Jeremy
    Jeremy avatar
    2 posts
    Member since:
    Mar 2015

    Posted 01 Sep 2015 in reply to Jeremy Link to this post

    Current mark up is like

    <kendo-mobile-button k-align="'right'" ​ng-disabled="viewModel.type != 2" ng-click="viewModel.save()">Save</kendo-mobile-button>
  5. Anton Dobrev
    Admin
    Anton Dobrev avatar
    539 posts

    Posted 04 Sep 2015 Link to this post

    @Jeremy

    Could you please consult the official documentation from here for the proper attribute usage. I am suspecting that the viewModel changes are not applied in the digest scope and thus the button is not updated.

    Let me know if this solves the issue.

    Regards,
    Anton Dobrev
    Telerik
     

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

     
Back to Top