Copied to clipboard

Flag this post as spam?

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


  • GianniDPC 6 posts 72 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);
        }
    
Please Sign in or register to post replies

Write your reply to:

Draft