Reputation: 193
I added the RichTextEditor, everything works functionally...
but the "FileBrowser" is not working, and I am getting this error...
I'm using (version 26.2.5).
all things up to date, and I tried to reproduce it in a fresh app. and still getting this error
my code:
import * as React from 'react';
import './fileManager.scss'
import { FileManagerComponent, Inject, NavigationPane, DetailsView, Toolbar } from '@syncfusion/ej2-react-filemanager';
import { API_URL } from "../../config";
/**
* File Manager full functionalities sample
*/
const FileManager = () => {
const hostUrl: string = API_URL;
function beforeAjaxRequestSent(args: any) {
args.ajaxSettings.beforeSend = function (xhr) {
xhr.httpRequest.setRequestHeader('X-Access-Token', localStorage.getItem("auth"));
}
}
const ajaxSettings =
{
url: hostUrl + "/fms",
getImageUrl: hostUrl + "/fms/GetImage",
uploadUrl: hostUrl + '/fms/Upload',
downloadUrl: hostUrl + '/fms/Download'
}
const toolbarSettings = {
items: ['NewFolder', 'Upload', 'SortBy', 'Cut', 'Copy', 'Paste', 'Delete', 'Refresh', 'Download', 'Rename', 'Selection', 'View', 'Details']
}
const contextMenuSettings = {
layout: ['Upload', '|', 'SortBy', 'View', 'Refresh', '|', 'Paste', '|', 'NewFolder', '|', 'Details', '|', 'SelectAll']
}
return (
<div>
<div className="control-section">
<FileManagerComponent id="file-manager"
beforeSend={beforeAjaxRequestSent}
enableRtl={true}
ajaxSettings={ajaxSettings}
toolbarSettings={toolbarSettings}
contextMenuSettings={contextMenuSettings}
fileSelect={d => console.log('selected file',d)}
height='40rem'
view={"Details"}>
<Inject services={[NavigationPane, DetailsView, Toolbar]} />
</FileManagerComponent>
</div>
</div>
);
}
export default FileManager;
Upvotes: 0
Views: 75