Skip to content

Commit 65659ca

Browse files
author
Dimo Dimov
committed
Improve imageUrl and fileUrl docs
1 parent 8f6397c commit 65659ca

File tree

1 file changed

+33
-4
lines changed

1 file changed

+33
-4
lines changed

api/javascript/ui/editor.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,9 +1544,9 @@ The requirements for this handler are the same as for the [save handler](/web/up
15441544

15451545
### imageBrowser.transport.imageUrl `String|Function`
15461546

1547-
The URL responsible for serving the original image. A file name placeholder should be specified.
1547+
The URL responsible for serving the original image. A file name placeholder should be specified. By default the placeholder value is URL encoded. If this is not desired, use a function.
15481548

1549-
#### Example
1549+
#### Example - imageUrl as String
15501550

15511551
<textarea id="editor"></textarea>
15521552
<script>
@@ -1559,6 +1559,21 @@ The URL responsible for serving the original image. A file name placeholder shou
15591559
});
15601560
</script>
15611561

1562+
#### Example - imageUrl as Function (can be used to avoid automatic URL encoding)
1563+
1564+
<textarea id="editor"></textarea>
1565+
<script>
1566+
$("#editor").kendoEditor({
1567+
imageBrowser: {
1568+
transport: {
1569+
imageUrl: function (e) {
1570+
return "/content/images/" + e;
1571+
}
1572+
}
1573+
}
1574+
});
1575+
</script>
1576+
15621577
### imageBrowser.transport.destroy `Object|String`
15631578

15641579
Options or URL which will handle the file and directory deletion. If not specified the delete button will not be present.
@@ -2337,9 +2352,9 @@ The URL which will handle the upload of the new files. If not specified the Uplo
23372352

23382353
### fileBrowser.transport.fileUrl `String|Function`
23392354

2340-
The URL responsible for serving the original file. A file name placeholder should be specified.
2355+
The URL responsible for serving the original file. A file name placeholder should be specified. By default the placeholder value is URL encoded. If this is not desired, use a function.
23412356

2342-
#### Example
2357+
#### Example - fileUrl as String
23432358

23442359
<textarea id="editor"></textarea>
23452360
<script>
@@ -2352,6 +2367,20 @@ The URL responsible for serving the original file. A file name placeholder shoul
23522367
});
23532368
</script>
23542369

2370+
#### Example - fileUrl as Function (can be used to avoid automatic URL encoding)
2371+
2372+
<textarea id="editor"></textarea>
2373+
<script>
2374+
$("#editor").kendoEditor({
2375+
fileBrowser: {
2376+
transport: {
2377+
fileUrl: function (e) {
2378+
return "/content/files/" + e;
2379+
}
2380+
}
2381+
});
2382+
</script>
2383+
23552384
### fileBrowser.transport.destroy `Object|String`
23562385

23572386
Options or URL which will handle the file and directory deletion. If not specified the delete button will not be present.

0 commit comments

Comments
 (0)