Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TreeList Excel Export exports only the expanded nodes since 2018 R3 (client paging) #4696

Closed
Alex-Bubblemaster opened this issue Dec 3, 2018 · 1 comment

Comments

@Alex-Bubblemaster
Copy link
Contributor

Alex-Bubblemaster commented Dec 3, 2018

Bug report

Ticket ID 1363446

Reproduction of the problem

TreeList exports the node with the children 2018 R2 SP1

Dojo

Pageable TreeList exports only the parent node

Dojo

Current behavior

TreeList does not export collapsed nodes

Expected/desired behavior

TreeList should export the collapsed nodes as before

Workaround

Implement a custom toolbar button, expand all nodes, export and then collapse them

 function customExport(){
          var treelist = $("#treelist").data("kendoTreeList");
          treelist.options.dataSource.schema.model.expanded = !treelist.options.dataSource.schema.model.expanded;
          treelist.setDataSource(treelist.options.dataSource);
          treelist.saveAsExcel();
          treelist.options.dataSource.schema.model.expanded = !treelist.options.dataSource.schema.model.expanded;
          treelist.setDataSource(treelist.options.dataSource);   
}

toolbar:[{ name: "customExcel", text: "Excel", imageClass:"k-icon k-i-excel" , click: customExport}]

Alternative Custom function suggested by client

    var treelist = $("#treelist").data("kendoTreeList");
    var dataItemsOriginal = JSON.parse(JSON.stringify(treeList.dataSource.data()));
    var dataItems = treeList.dataSource.data();
    $.each(dataItems, function (i, item) {
       item.expanded = true;
    });
    treeList.dataSource.data(dataItems);
    treeList.saveAsExcel();
    treeList.dataSource.data(dataItemsOriginal);

Additional Information

Possibly related with private issue #9029

Environment

  • Kendo UI version: 2018.3.911
@Alex-Bubblemaster
Copy link
Contributor Author

If the expanded:false setting is not present, not all pages are exported. Reported in ticket 1389408 .
Dojo - https://dojo.telerik.com/upuLEFeW

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants