Copied to clipboard

Flag this post as spam?

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


  • GianniDPC 14 posts 80 karma points
    Oct 05, 2021 @ 07:49
    GianniDPC
    0

    AngularJS editorservice filter on media type

    How can I filter on media type(s) using the mediapicker in angular? I see no such option in the documentation see my example below.

    $scope.openMediaPicker = function (prop) {
        var mediaPickerOptions = {
            multiPicker: false,
            submit: function (model) {
                $scope.vm.tabledata.ListEditPropertyData.forEach(function (element, index) {
                    if (element.FieldName == prop.FieldName) {
                        $scope.vm.tabledata.ListEditPropertyData[index].PropertyValue = model.selection[0].id;
                        $scope.vm.tabledata.ListEditPropertyData[index].ImageUrl = model.selection[0].image;
                    }
                });
    
                editorService.close();
            },
            close: function () {
                editorService.close();
            }
        };
    
        if (prop.PropertyEditoryType == 'image') {
            mediaPickerOptions.onlyImages = true;
        }
    
        if (prop.PropertyEditorOptions != null && prop.PropertyEditorOptions.RootFolderId) {
            mediaPickerOptions.startNodeId = parseInt(prop.PropertyEditorOptions.RootFolderId);
        }
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies