<template>
<div id="app">
<div id="wrapper1">
<ejs-textbox floatLabelType="Auto" placeholder="Enter a name" v-model="value"></ejs-textbox>
</div>
</div>
</template>
<script>
import Vue from 'vue';
import { TextBoxPlugin } from '@syncfusion/ej2-vue-inputs';
Vue.use(TextBoxPlugin);
export default {
data: function(){
return {
value: null
}
}
}
<template>
<div id="app">
<div id='container' style="margin:50px auto 0; width:250px;">
<br>
<ejs-dropdownlist id='dropdownlist' placeholder='Select a customer' sortOrder='Ascending' :dataSource='dataSource' :query='query' :fields='fields'></ejs-dropdownlist>
</div>
</div>
</template>
<script>
import Vue from 'vue';
import { DropDownListPlugin } from "@syncfusion/ej2-vue-dropdowns";
Vue.use(DropDownListPlugin);
import { DataManager,Query,ODataV4Adaptor } from "@syncfusion/ej2-data";
export default {
data (){
return {
query : new Query().from('Customers').select(['ContactName', 'CustomerID']).take(6),
dataSource : new DataManager({
url: 'http://services.odata.org/V4/Northwind/Northwind.svc/',
adaptor: new ODataV4Adaptor,
crossDomain: true
}),
fields: { text: 'ContactName', value: 'CustomerID' }
}
}
}
<template>
<div id="app">
<div id="wrapper1">
<ejs-textbox floatLabelType="Auto" placeholder="Enter a name" :change="UrlChange"></ejs-textbox>
<ejs-dropdownlist id='dropdownlist' ref='dropdownObj' placeholder='Select a customer' sortOrder='Ascending' :dataSource='dataSource' :query='query' :fields='fields'></ejs-dropdownlist>
</div>
</div>
</template>
<script>
import Vue from 'vue';
import { TextBoxPlugin } from '@syncfusion/ej2-vue-inputs';
Vue.use(TextBoxPlugin);
import { DropDownListPlugin } from "@syncfusion/ej2-vue-dropdowns";
Vue.use(DropDownListPlugin);
import { DataManager,Query,ODataV4Adaptor } from "@syncfusion/ej2-data";
export default {
data: function(){
return {
query : new Query().from('Customers').select(['ContactName', 'CustomerID']).take(6),
dataSource : new DataManager({
url: 'http://services.odata.org/V4/Northwind/Northwind.svc/',
adaptor: new ODataV4Adaptor,
crossDomain: true
}),
fields: { text: 'ContactName', value: 'CustomerID' }
}
},
methods: {
UrlChange: function(e) {
this.$refs.dropdownObj.$el.ej2_instances[0].dataSource = new DataManager({
url: e.value,
adaptor: new ODataV4Adaptor,
crossDomain: true
})
}
}
}
|