Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Koen van Ras 56 posts 361 karma points c-trib
    Oct 03, 2019 @ 09:17
    Koen van Ras
    0

    Button state busy custom Section

    Hi,

    I'm creating a custom section in Umbraco V8 for an export plugin. Now I want to generate an export when creating the export button in the footer of the section, this works but when I click on the export button, I want to change the state to busy so that the user can't click it again and it is visible that Umbraco is working.

    I created the button using the following documentation: https://our.umbraco.com/apidocs/v8/ui/#/api/umbraco.directives.directive:umbButtonGroup

    Though I'm not sure how to call the button and change the state from the handler and from another angular function.

    enter image description here

  • Tobias Klika 101 posts 570 karma points c-trib
    Oct 03, 2019 @ 10:01
    Tobias Klika
    100

    You can use the umb-button directive in case you don't need a group.

    <div ng-controller="MyController">
      <umb-button type="button" action="export()" state="exportState" label="Export" />
    </div>
    

    And for the controller:

    angular.module("umbraco").controller("MyController", function ($scope)
    {
      $scope.exportState = 'default';
    
      $scope.export = function ()
      {
        $scope.exportState = 'busy';
        // TODO implementation here
      };
    });
    
  • Koen van Ras 56 posts 361 karma points c-trib
    Oct 03, 2019 @ 11:44
    Koen van Ras
    0

    Thanks! I need a button group because there are some more options available later, for example download latest export. Though this helped because I implemented the export in the button group object and call it from there.

Please Sign in or register to post replies

Write your reply to:

Draft