I want to use the ImageBrowser with services that perform the requested operations.. I've got my transport.read, transport.create, transport.destroy services created just fine and everything works. However, the imageUrl and thumbnailUrl properties leave me baffled. So transport.thumbnailUrl hard-codes a ?path={url} to whatever url you give it ... this seems like a major hack. I want to use a REST service with the generation of the thumbnail and I need to supply additional query string parameters, but the current implementation precludes doing so. At least imageUrl lets me pass in a function or a parameterized string, but imageUrl ALWAYS tacks on the current relative path. The images that I'm using get stored in a DB by the service, so doing so makes no sense. Both these properties should have the same abilities as the create,read, and destroy -- let me control what is passed in explicitly.
Hello Christian,
Thank you for your input on the discussion.
As per the uploadUrl case, there is a workaround that might be applicable to your scenario. That option is used by a Kendo Upload widget, which sends the file in question to the remote endpoint. You could add a custom header to that request by handling the upload event of the Upload widget as explained in the following forum thread:
https://www.telerik.com/forums/custom-authorization-header-for-upload#FRi3NUFssUe8V3kzirsLoQ
In the Editor scenario, that could be done in the execute event of the widget:
execute: function(e) {
setTimeout(function() {
var upload = $('.k-filebrowser-dialog input[data-role="upload"]').getKendoUpload();
if(upload) {
upload.unbind('upload');
upload.bind('upload', function(ev) {
var xhr = ev.XMLHttpRequest;
if (xhr) {
xhr.addEventListener("readystatechange", function onReady(e) {
if (xhr.readyState == 1 /* OPENED */) {
xhr.setRequestHeader("foo", "bar");
xhr.removeEventListener("readystatechange", onReady);
}
});
}
})
}
});
},
Here is a small Dojo sample implementing the above suggestion:
https://dojo.telerik.com/ogulUqiZ/7
Regards,
Veselin Tsvetanov
Progress Telerik
The uploadUrl parameter is also out of standard.
I request to have the option to add an authorization header here.
And making the imageUrl and thumbnailUrl like the other transport properties will allow to set an antiforgery token in the headers when you need that.