We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Filter not woking after change datasource

When datasource load the first time, filtering is working. But after I change datasource depends on other component, it didn't work.


4 Replies

IL Indhumathy Loganathan Syncfusion Team November 8, 2022 02:48 PM UTC

Hi Hieu,


Greetings from Syncfusion support.


The reported issue with filtering in the Dropdown Tree component may occur due to the component not being properly refreshed after a data update. To overcome the issue, you can follow the below steps to update the Dropdown Tree data and refresh the component to perform filtering.


//Update the Dropdown Tree data.

onClick() {

var newData = [

    { id: 16, name: 'MP3 Albums', hasChild: true },

    { id: 17, pid: 16, name: 'Rock' },

    { id: 18, pid: 16, name: 'Gospel' },

    { id: 19, pid: 16, name: 'Latin Music' },

    { id: 20, pid: 16, name: 'Jazz' },

    { id: 21, name: 'More in Music', hasChild: true },

    { id: 22, pid: 21, name: 'Music Trade-In' },

    { id: 23, pid: 21, name: 'Redeem a Gift Card' },

    { id: 24, pid: 21, name: 'Band T-Shirts' },

    { id: 25, name: 'Fiction Book Lists', hasChild: true },

    { id: 26, pid: 25, name: 'To Kill a Mockingbird' },

    { id: 27, pid: 25, name: 'Pride and Prejudice' },

    { id: 28, pid: 25, name: 'Harry Potter' },

    { id: 29, pid: 25, name: 'The Hobbit' },

];

this.ddTree.fields = {

    dataSource: newData,

    value: 'id',

    parentValue: 'pid',

    text: 'name',

    hasChildren: 'hasChild',

};

this.ddTree.refresh();

}


Sample: https://stackblitz.com/edit/angular-q6qvfo?file=app.component.html,app.component.ts


Regards,

Indhumathy L



UN Unknown replied to Indhumathy Loganathan November 11, 2022 02:29 AM UTC

Thank for your sample,

I try to follow your sample but when I use filtering don't choose any item in dropdown tree and after that I choose other item in dropdown list which dropdown tree datasource depends on, I got this error message.

Sorry for my bad english.




IL Indhumathy Loganathan Syncfusion Team December 16, 2022 04:00 PM UTC

Hieu, We have validated the mentioned issue in the Angular Dropdown Tee component and are able to reproduce the issue on our end. We have considered the reported issue a bug, and the fix for this issue will be included any of our upcoming releases.


You can track the status of the issue's fix using the following feedback link:


https://www.syncfusion.com/feedback/39852/facing-an-error-while-dynamically-updating-data-after-performing-filtering-in-the



LD LeoLavanya Dhanaraj Syncfusion Team December 30, 2022 12:06 PM UTC

Hi Heiu,


Thanks for your patience.


We are glad to announce that our patch release (V20.4.40) has been rolled out successfully. The issues with “Facing an error while dynamically updating data after performing filtering in the Dropdown Tree” have been resolved in this release.


To access this fix, we suggest you update the package to 20.4.40 and we include the sample in the latest version for your reference.


Samplehttps://stackblitz.com/edit/angular-dbbkhk-vipibf?file=app.component.ts,app.component.html


Feedback: https://www.syncfusion.com/feedback/39852/facing-an-error-while-dynamically-updating-data-after-performing-filtering-in-the


Release Notes : https://ej2.syncfusion.com/documentation/release-notes/20.4.40/?type=all#dropdown-tree


Regards,

Leo Lavanya Dhanaraj


Loader.
Live Chat Icon For mobile
Up arrow icon