Search
ImagePicker Class
See Also
 






Represents an input control with the ability to select images from the filesystem or a predefined list.

Namespace: MindFusion.Common.UI
File: ImagePicker.js

 Syntax

JavaScript  Copy Code

// class
ImagePicker.prototype = {}

 Example

The following code creates an ImagePicker with an initial list of 3 images and handles its valueChanging event:

JavaScript  Copy Code

var u = MindFusion.Common.UI;

var imagePicker = u.ImagePicker(document.getElementById("image_picker"));
imagePicker.imageList = ["my-folder/myImage.png", "my-folder1/myImage1.png", "my-folder2/myImage2.png"];

imagePicker.valueChanging.addEventListener(handleValueChanging);

function handleValueChanging(sender, args)
{
    //check the replaced image
    if(args.oldValue.url != "my-folder/myImage.png")
    {
       args.cancel = true;
    }
}

 Inheritance Hierarchy

MindFusion.Common.UI.Picker
    MindFusion.Common.UI.ImagePicker

 See Also