Does the FileManager for Kendo UI support AngularJS like the grid? I have tried initializing the file manager with the following code:
HTML
<div id="fileBrowser" kendo-file-manager="fileBrowser" k-options="fileBrowserOptions"></div>
NOTE: I have tried the following for the attributes:
kendo-file-manager
kendo-filemanager
AngularJS
$scope.fileBrowserOptions = {
dataSource: {
schema: kendo.data.schemas.filemanager,
transport: {
read: {
url: "/kendo-ui/service/FileManager/Read",
method: "POST"
},
create: {
url: "/kendo-ui/service/FileManager/Create",
method: "POST"
},
update: {
url: "/kendo-ui/service/FileManager/Update",
method: "POST"
},
destroy: {
url: "/kendo-ui/service/FileManager/Destroy",
method: "POST"
}
}
},
uploadUrl: "/kendo-ui/service/FileManager/Upload",
toolbar: {
items: [
{ name: "createFolder" },
{ name: "upload" },
{ name: "sortDirection" },
{ name: "sortField" },
{ name: "changeView" },
{ name: "spacer" },
{ name: "details" },
{ name: "search" }
]
},
contextMenu: {
items: [
{ name: "rename" },
{ name: "delete" }
]
},
draggable: true,
resizable: true
};
When I run the code nothing happens. No errors in the console.
Thanks for any help.
Robert
I overwrote the FileManagers MoveCommand to implement my own logic. Afterwards I do call the FileManagers refresh method. Unfortunately, this seems to update only the ListView/GridView, but not the TreeView.
So, when I move a subfolder between two folders, the folder has been moved correctly, the GridView/ListView then refreshes perfectly, but in the TreeView I can still see the subfolder in the old location (source folder). If I click the TreeViews target folder, the moved subfolder occurs. When I click the TreeViews source folder, the subfolder is still there (although it should not).
How can I force the FileManagers TreeView to do a full refresh (and reload all data)?
Thanks for any advice!
Patrick
Is there a way to remove copy and only confirm Move when dragging and dropping a file?
I tried manipulating options.messages.dialogs.moveConfirm to show only move, but I still have a small button for Copy
filemanager.options.messages.dialogs.moveConfirm.content = '<p style="text-align: center;">Do you want to move file?</p>';
filemanager.options.messages.dialogs.moveConfirm.okText = '';
I added a custom template for the Upload Widget. The file size (#=size#) prints to a byte value. How can I format the file size (#=size#) to print in KB instead of Bytes - and with two decimals? (like the upload widgets default)
I added the template as a function, as mentioned here.
Thanks for any advice!
Patrick
When using the filemanager's upload button to upload the files, everything works correctly. The files uploaded show on the list and I can see when the file upload is complete.
But if I drag and drop the files into a folder, the files are also uploaded, but I don't see the list of files, if these are large files, I can not tell when the transfer is complete.
How can I make the filemanager display the show the list of files uploaded when a drag and drop happens?
Dear Sir or Madam,
FileManager: When I click the "New Folder" toolbar button, a new folder is created (called "New Folder"). I would like to know, if and how it is possible to localize the default name of new folders? Unfortunately, this is not mentioned in your documentation.
Is it possible to localize the default name of a new folder? (e.g. to its German translation "Neuer Ordner")
I look forward to your reply!
Yours sincerely,
Patrick
Hi Admin and Everybody,
As the title, Currently I have read all data from the folder to the corresponding items of folder. But data children ( see picture 1.png ), can not reload when using ".read()".
When I using code call ".read". Only the area on the left hand side reloads, and the area on the right hand side doesn't happen.
More specifically, it's the children data area that doesn't reload when call ".read()"
$("#filemanager").data("kendoFileManager").dataSource.read(); // my code call .read()
My code will show all data to file manager:
$("#filemanager").kendoFileManager({
dataSource: {
transport: {
read: function (options) {
var that = this;
$.ajax({
url: "my url",
dataType: "json",
method: "POST",
data: that.parameterMap ? that.parameterMap(options.data, "read") : options.data,
success: function (result) {
options.success(result);
}
});
},
},
schema: {
data: 'data',
model: {
id: 'path',
children: 'items'
}
}
},
toolbar: {
items: [
{ name: "custom", type: "button", text: "Create", command: "MyCustomCommandCreate" },
{ name: "custom", type: "button", text: "Upload", command: "MyCustomCommandUpload" },
{ name: "sortDirection" },
{ name: "sortField" },
{ name: "changeView" },
{ name: "spacer" },
{ name: "details" },
{ name: "search" }
]
},
contextMenu: {
items: [
{ name: "rename" },
{ name: "delete" },
{ name: "custom", text: "Detect", command: "MyCustomCommandDetect", spriteCssClass: "k-icon k-i-info" }
]
},
draggable: true,
resizable: true
});
My json data has a structure similar to that of demo from docs Kendo ( https://docs.telerik.com/kendo-ui/api/javascript/ui/filemanager/configuration/datasource ) - EXAMPLE
Image show you my Json Data inside url link: ( 1.png )
I have two link demo from Kendo FileManager.
First link: https://dojo.telerik.com/oFefoyIm
Second link: https://dojo.telerik.com/OxAWOrIF
Each link uses a different method of Kendo FileManager. But, with Second link, I can call function.
Otherwise, First link can not call.
Two image will show you my test, and And I am having a similar case in First Link in my project, it cannot call the function
Can kendo FileManager show images like Image Browser? If It can, please guide for me.
demo image browser: https://demos.telerik.com/kendo-ui/editor/imagebrowser
Image broswer can show image, that so good
Kendo FileManager is the manager must show the user how the images are?
Or can apply show image from Image Browser to FileManager. Please guide for me. Thanks
Hi admin and everybody,
Image show result I need
I want get name or path of items inside folder. You can follow code:
<div id="fileManager"></div>
<script>
var baseUrl = "https://demos.telerik.com/kendo-ui/service/filemanager/";
$("#fileManager").kendoFileManager({
dataSource: {
transport: {
read: function(options) {
var that = this;
$.ajax({
url: baseUrl + "Read",
dataType: "json",
method: "POST",
data: that.parameterMap ? that.parameterMap(options.data, "read") : options.data,
success: function(result) {
options.success(result);
}
});
},
update: function(options) {
var that = this;
$.ajax({
url: baseUrl + "Update",
dataType: "json",
method: "POST",
data: that.parameterMap ? that.parameterMap(options.data, "read") : options.data,
success: function(result) {
options.success(result);
}
});
},
create: function(options) {
var that = this;
$.ajax({
url: baseUrl + "Update",
dataType: "json",
method: "POST",
data: that.parameterMap ? that.parameterMap(options.data, "read") : options.data,
success: function(result) {
options.success(result);
}
});
},
destroy: function(options) {
console.log(options.data.name); // can get name items
}
}
},
uploadUrl: "/kendo-ui/service/FileManager/Upload",
toolbar: {
items: [
{ name: "createFolder" },
{ name: "upload" },
{ name: "sortDirection" },
{ name: "sortField" },
{ name: "changeView" },
{ name: "spacer" },
{ name: "details" },
{ name: "search" }
]
},
contextMenu: {
items: [
{ name: "rename" },
{ name: "delete" },
{ name: "custom", text: "Get Info", command: "MyCustomCommand", spriteCssClass:"k-icon k-i-info" }
]
},
draggable: true,
resizable: true
});
var filemanagerNS = kendo.ui.filemanager;
filemanagerNS.commands.MyCustomCommand = filemanagerNS.FileManagerCommand.extend({
exec: function(options){
var data = $("#fileManager").data("kendoFileManager").dataSource.data();
console.log(options.data.name); // What I need to do here to get name with button custom?
}
});
</script>