Posted 9 December 2020, 3:52 pm EST
Hello,
I’m a wijmo beginner and I’m having an issue with the AutoComplete control. Essentially what im trying to accomplish is to format the display of the control with custom html for display purposes only. Im running into an issue where using the itemFormatter property is breaking the search. I was able to replicate the issue in the Vue version of the demo, see below.
–this is the initial page i used to test
https://www.grapecity.com/wijmo/demos/Input/AutoComplete/Searching/Styling/vue
–this is the updated code in the app.vue section. Please type united in the searchbox and notice how the auto complete is broken… what am i missing?
<template>
<div class="container-fluid">
<div class="form-group">
<label for="theAutoComplete">AutoComplete:</label>
<wj-auto-complete id="theAutoComplete"
:itemsSource="data" :itemFormatter="itemFormat" :headerPath="'country'"
:searchMemberPath="'country'" :isContentHtml="true">
</wj-auto-complete>
</div>
</div>
</template>
<script>
import 'bootstrap.css';
import '@grapecity/wijmo.styles/wijmo.css';
import Vue from 'vue';
import '@grapecity/wijmo.vue2.core';
import '@grapecity/wijmo.vue2.input';
import { getData } from './data';
let App = Vue.extend({
name: 'app',
data: function () {
return {
data: getData()
}
},
methods:{
itemFormat: function(idx, content){
content = "<h3><b>" + this.$data.data[idx].country + "</b></h3>"
return content;
}
}
})
new Vue({ render: h => h(App) }).$mount('#app');
</script>
<style>
.wj-state-match {
border: 1px solid #DFB8B7;
border-radius: .25em;
background: #DFB8B7;
}
label {
margin-right: 3px;
}
</style>