imageBrowser.transport.read Object|String|Function

Options or URL for remote image retrieval.

Important: The value of transport.read is passed to jQuery.ajax.

Example - specify a read URL

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
  imageBrowser: {
    transport: {
      read: "/imagebrowser/read"
    }
  }
});
</script>

Example - specify read as a function

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
  imageBrowser: {
    transport: {
      read: function(options) {
          // query async service, then call options.success or options.error
          options.success([
            { "name": "foo", "type": "d" },
            { "name": "bar.png", "type": "f", "size": 15289 }
          ]);
      }
    }
  }
});
</script>

imageBrowser.transport.read.contentType String (default: "application/x-www-form-urlencoded")

The content-type HTTP header sent to the server. Use "application/json" if the content is JSON. Refer to the jQuery.ajax documentation for further info.

Example

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
  imageBrowser: {
    transport: {
      read: {
        /* omitted for brevity */
        contentType: "application/json"
      }
    }
  }
});
</script>

imageBrowser.transport.read.data Object|String|Function

Data to be send to the server. Refer to the jQuery.ajax documentation for further info.

Example - specify Data As Object

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
  imageBrowser: {
    transport: {
      read: {
        data: {
          id: 42,
          name: "John Doe"
        }
      }
    }
  }
});
</script>

Example - specify Data As Function

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
  imageBrowser: {
    transport: {
      read: {
        data: function() {
          return { id: 42, name: "John Doe" };
        }
      }
    }
  }
});
</script>

imageBrowser.transport.read.dataType String

The type of data that you're expecting back from the server. Commonly used values are "json" and "jsonp". Refer to the jQuery.ajax documentation for further info.

Example

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
  imageBrowser: {
    transport: {
      read: {
        dataType: "json"
      }
    }
  }
});
</script>

imageBrowser.transport.read.type String

The type of request to make ("POST", "GET", "PUT" or "DELETE"), default is "POST". Refer to the jQuery.ajax documentation for further info.

Example

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
  imageBrowser: {
    transport: {
      read: {
        type: "POST"
      }
    }
  }
});
</script>

imageBrowser.transport.read.url String|Function

The remote url to call when fetching list of items.

Example

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
  imageBrowser: {
    transport: {
      read: {
        url: "/read"
      }
    }
  }
});
</script>

Example - specify Read URL As Function

<textarea id="editor"></textarea>
<script>
$("#editor").kendoEditor({
  imageBrowser: {
    transport: {
      read: {
        url: function(params) {
          // build url
          return "/read?t=" + new Date().getTime();
        }
      }
    }
  }
});
</script>
In this article