Hi Yavor,
Thank you for the reply, I have see the demos and try to reload the datasource for my TreeGrid (I don’t reload the page but only change the datasource in the same smart-grid element), but the smart-grid element is not reloaded with new datasource,┬áthis changes correctly only if I dynamically remove and re-create the smart-grid element. If I recall the same function for 3 times (for example) with 3 different datasource, also the export create 3 files with the first datasource.
In the html page I have the tag:
<smart-grid id=”treeGrid” style=”width: 100%”></smart-grid>
and in the js, when click the button for obtain the datasource, I call this function:
function loadTreeGrid(myDataSourceArray) {
var grid = document.querySelector(‘#treeGrid’);
new window.Smart(‘#treeGrid’, class {
get properties() {
return {
behavior: { columnResizeMode: ‘growAndShrink’ },
filtering: {
enabled: true
sorting: {
enabled: false
dataSource: new window.Smart.DataAdapter(
dataSource: myDataSourceArray,
keyDataField: ‘id’,
parentDataField: ‘idFather’,
id: ‘id’,
‘id: number’,
‘idFather: number’,
‘Field1: string’,
‘Field2: string’,
‘Field3: string’,
‘Field4: string’,
‘Field5: number’,
columns: [
label : ‘Field1’,
dataField : ‘Field1’,
label : ‘Field2’,
dataField : ‘Field2’,
label : ‘Field3’,
dataField : ‘Field3’,
label : ‘Field4’,
dataField : ‘Field4’,
label : ‘Field5’,
dataField : ‘Field5’,
var xlsxBtn = document.querySelector(‘#excelExport’);
var htmlBtn = document.querySelector(‘#csvExport’);
xlsxBtn.addEventListener(‘click’, () => {
htmlBtn.addEventListener(‘click’, () => {
This is an example format of my Datasource (the stringify of my datasource):
It’s possible to reload the smart-grid element with different datasource without recreate the element?
Walter Mariani