[]
Document Solutions Data Viewer control.
new DsDataViewer(element): DsDataViewer;
Document Solutions Data Viewer constructor.
root container element or selector pattern used to select the root container element.
string
| HTMLElement
DsDataViewer
static LicenseKey: string;
Product license key.
<script>
// Add your license
DsDataViewer.LicenseKey = 'XXX';
// Add your code
const viewer = new DsDataViewer("#viewer");
</script>
get sidebarLayout(): string[];
Get the current sidebar layout information.
viewer.sidebarLayout
string
[]
set sidebarLayout(sidebarLayout): void;
Sets the sidebar layout information and modify layout. Currently supported: SearchPanel.
// Open SearchPanel
viewer.sidebarLayout = ['SearchPanel'];
// Clear all sidebars
viewer.sidebarLayout = [''];
// Default sidebar layout
viewer.sidebarLayout = [];
string
[]
void
get toolbarLayout(): DataToolbarLayout;
Get the current toolbar layout information.
viewer.toolbarLayout
set toolbarLayout(buttons): void;
Sets the toolbar layout information and modify layout.
viewer.toolbarLayout = { default: ['open', 'zoom', 'fullscreen', 'theme-change'] }
The toolbar layout information.
void
static findControl(selector): DsDataViewer;
Gets the viewer instance using the host element or host element selector
string
| HTMLElement
DsDataViewer
var viewer = DsDataViewer.findControl("#root");
dispose(): void;
Use this method to close and release resources occupied by the DsDataViewer.
void
getActiveSheet(): WorkSheet;
Fetches the active sheet.
The active sheet instance.
viewer.getActiveSheet()
getSheet(index): WorkSheet;
Fetches the specified sheet based on the index.
number
The index of the sheet to return.
The specified sheet.
viewer.getSheet(0)
getSheetFromName(name): WorkSheet;
Fetches the sheet with the specified name.
string
The sheet name.
The sheet with the specified name.
viewer.getSheetFromName("Sheet1")
openFile(
file,
fileType,
openOptions?): void;
Open data file.
Blob
The data file.
The type of the imported data file.
The options for imported data file.
XlsxOpenOptions
| SSJsonOpenOptions
| CsvOpenOptions
| SjsOpenOptions
void
viewer.openFile("Documents/HelloWorld.xlsx", FileType.XLSX, {loadHiddenSheets: true});
showSidebar(show): void;
Set the visibility of the sidebar.
boolean
The visibility of the sidebar.
void
viewer.showSidebar(true)