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

Tree Data row collapse does not work with backendApi and localFilter = false #658

Closed
chitwank-asu opened this issue Jan 5, 2021 · 3 comments · Fixed by #669
Closed

Tree Data row collapse does not work with backendApi and localFilter = false #658

chitwank-asu opened this issue Jan 5, 2021 · 3 comments · Fixed by #669

Comments

@chitwank-asu
Copy link

chitwank-asu commented Jan 5, 2021

I'm submitting a Bug report

Your Environment

Software Version(s)
Angular 11.0.4
Angular-Slickgrid 2.24.1
TypeScript 4.0.2

Describe the Bug

The expand and collapse button does not work( as they do in the below demo) when we add backendServiceApi and set backendServiceApi.useLocalFiltering = false
https://ghiscoding.github.io/angular-slickgrid-demos/#/tree-data-parent-child

Steps to Reproduce

Copy the code of the following demo, but instead of local data use backendServiceApi to load and assign data to the grid with backendServiceApi.useLocalFiltering = false
https://ghiscoding.github.io/angular-slickgrid-demos/#/tree-data-parent-child

On doing so, the collapse and expand icon stop working. They do not hide and show the child rows:
image

Expected Behavior

The expand and collapse icons should work even when the data is loaded from backend and backendServiceApi.useLocalFiltering = false

Current Behavior

The expand and collapse button does not work when we add backendServiceApi and set backendServiceApi.useLocalFiltering = false
https://ghiscoding.github.io/angular-slickgrid-demos/#/tree-data-parent-child
Error img:
image

Possible Solution

Code Sample

 this.gridOptions = {
      enableTreeData: true, // you must enable this flag for the filtering & sorting to work as expected
      treeDataOptions: {
        columnId: 'client',
        levelPropName: 'indent',
        parentPropName: 'parentId'
      },
      enableFiltering: true,
      enableRowSelection: true,
      backendServiceApi: {
        service: new GridOdataService(),
        ...
        }
    }
@ghiscoding
Copy link
Owner

I have no time to investigate this but I would say though that if you're trying to use Tree Data with a Backend Service (mainly Pagination), I just will not provide support for that. The reason is simple, there's no way to know when and where the Tree might stop/start between pages... so where you using Pagination with your backend service? If the answer is Yes then sorry but I will close this issue as "won't do"

@chitwank-asu
Copy link
Author

Thanks for your reply.
Yeah, we are using backend with pagination. So, what solution would you recommend for this? Backend without pagination and local filter - true?

@ghiscoding
Copy link
Owner

ghiscoding commented Jan 7, 2021

useLocaleFiltering was only created for Backend Services, it is useful when you want to use GraphQL/OData Service to create the query string for you and retrieve all the data once and then use local (in-memory) filtering. That is usually used without Pagination because local filtering assumes you have all the data in memory hence using local (in-memory) filtering and that really means without pagination which is what the Example 27 does.

Tree Data just doesn't work with Pagination (that is also true for local in-memory pagination), as a side note that is also true for Grouping as well. What it means is that you need to load all your data and then you'll be able to use Tree Data.

It should work with backendServiceApi.useLocalFiltering = true but it won't work if you put it to false and by the way there is no reason to put it to false because that is the default anyway (in other words you should only ever use useLocalFiltering with true else just don't use that option) and that also equals to using Pagination which again is just not supported with Tree Data. If you really want Tree Data, you can use it with useLocalFiltering set to true, it should work.

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

Successfully merging a pull request may close this issue.

2 participants