itemtemplate is working properly if datasource is binded initially but after rebind it is not working
itemTemplate: function() {
return { template: Vue.component('itemTemplate', { template: `<span>{{data.itemCode}} - {{ data.itemDescription}}</span>` }) }
}
<ejs-dropdownlist :itemTemplate='itemTemplate' :popupWidth="600" :width="250" id="dropdownlist" placeholder="Select Stock" sort-order="Ascending" :allow-filtering="true" :filtering="filtering" :data-source="stockDataSource" :fields="fields" />
filtering: async function(args) {
if (args.text && args.text.length > 2) {
const result = (await apiGetStocks(args.text)).data
this.stockDataSource = result
}
}
as far as i researched before this bug is solved for angular but for vue it is still going
Hi Ponmani thank you for your interest
Actually the problem is occuring when using filtering.
Normally, if the itemTemplate is not used, the captured data appears directly in the pop-up, but when we use the itemtemplate, it says no record found.
I attached project files. only changed a few lines code on app.vue.
Please review my sended file
thanks
|
<ejs-dropdownlist :allowFiltering="allowFiltering" :filtering="filtering" ref="dropdownObj" id='multi-template' :dataSource='data' :fields='fields' :placeholder='watermark' :itemTemplate='iTemplate' popupHeight="450px"></ejs-dropdownlist>
filtering: function(args) {
if(args.text) {
fetch("https://61ae9610a7c7f3001786f8cc.mockapi.io/api/syncfusionapitest/remoteDropDownDataSource")
.then((response) => response.json())
.then((body)=> {
console.log(body.data)
var dropObj = document.getElementById("multi-template").ej2_instances[0];
dropObj.dataSource = null;
dropObj.dataSource = body.data;
dropObj.dataBind();
})
} |
Hi Berly
unfortunality it is still not working. Please check it I typing any word in search text input it says no record found.
Only If I click outside to close search popup and reclick the dropdown then I can see rendered itemTemplate results
I dont see anything immediately after typing search text.
|
filtering: function(args) {
if(args.text) {
var proxy = args;
fetch("https://61ae9610a7c7f3001786f8cc.mockapi.io/api/syncfusionapitest/remoteDropDownDataSource")
.then((response) => response.json())
.then((body)=> {
console.log(body.data)
var dropdown_query = new Query();
dropdown_query = (proxy.text !== '') ? dropdown_query.where('Name', 'contains', proxy.text, true) : dropdown_query;
proxy.updateData(body.data,dropdown_query);
})
}
}, |