Copied to clipboard

Flag this post as spam?

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


  • Simon 81 posts 184 karma points
    Oct 20, 2017 @ 14:52
    Simon
    0

    Tags property editor in a custom dialog

    Hi,

    I'm developing a package that has a custom dialog in it. I need to use a tags property editor for one of the controls.

    This gave a great starting point: how to reuse an Umbraco property editor but I'm struggling with using a tags control.

    Here's where I am at the moment: dialog.html

    <div ng-controller="InteractiveHubQuestionButtonDialogController">
    
    <form name="insertkeyvalue_form" novalidate>
        <div class="umb-overlay umb-overlay-right">
            <div class="umb-overlay-header">
                <h4 class="umb-overlay__title">Interactive hub page button</h4>
            </div>
    
            <div class="umb-overlay-container form-horizontal">
    
                <div class="control-group umb-control-group">
                    <label class="control-label">Top level tags</label>
                    <umb-editor model="tagsCtrl"></umb-editor>
                    <input type="hidden" name="tagCount" ng-model="model.value.length" />                    
                </div>
            </div>
        </div>
      </form>
    </div>
    

    then in the controller I initialise the tagsCtrl by:

    $scope.tagsCtrl = {
        view: 'tags',
         config: {
             group: "interactiveHubTags",
             storageType: "csv"
         },
         validation: {
             mandatory: true
         },
         value: $scope.dialogData.value.topLevelTags
    };
    

    The problem I have is that whenever a tag is added, I get an error from the tag control:

    Cannot read property 'tagCount' of undefined at addTag (umbraco.controllers.js?cdv=1946648011:17848) at Object.$scope.addTag (umbraco.controllers.js?cdv=1946648011:17867) at Object.$scope.addTagOnEnter (umbraco.controllers.js?cdv=1946648011:17859) at angular.min.js?cdv=1946648011:74 at angular.min.js?cdv=1946648011:156 at a.$eval (angular.min.js?cdv=1946648011:92) at a.$apply (angular.min.js?cdv=1946648011:92) at HTMLInputElement.

    Looking at the code, it seems to be having trouble with this line in the umbraco.controllers.js file in the addTag method: $scope.propertyForm.tagCount.$setViewValue($scope.model.value.length);

    Any help would be great.

    Thanks

    Simon

Please Sign in or register to post replies

Write your reply to:

Draft