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

ListBox filter

Please give me an example using listbox filter with remote data

1 Reply

AD Arunkumar Devendiran Syncfusion Team November 16, 2019 10:10 PM

Hi Roberto, 
 
Thank you for contacting Syncfusion support. 
 
We have checked your reported query and We have create the sample for your scenario, in that we have using Datamanager for filter the required data in the remote URL.  
 
Please refer the below code snippet and sample link, 
 
Html 
 
<body> 
   <input id='listbox' /> 
</body> 
 
 
 
app.ts 
import { ListBox } from '@syncfusion/ej2-dropdowns'; 
import { Query, DataManager, ODataV4Adaptor } from '@syncfusion/ej2-data'; 
let listObj: ListBox = new ListBox({ 
 
    dataSource: new DataManager({ 
        url: 'https://services.odata.org/V4/Northwind/Northwind.svc/', 
        adaptor: new ODataV4Adaptor 
    }), 
    query: new Query().from('Products').select('ProductName').where('ProductID', 'greaterthan', 2).take(4), 
    fields: { text: 'ProductName' } 
}); 
listObj.appendTo('#listbox'); 
 
 
Sample Link: 
 
Regards, 
Arunkumar D 


Loader.
Live Chat Icon For mobile
Up arrow icon