diff --git a/ej2-vue/auto-complete/virtual-scroll.md b/ej2-vue/auto-complete/virtual-scroll.md index f05aaaaa3..7c104ffed 100644 --- a/ej2-vue/auto-complete/virtual-scroll.md +++ b/ej2-vue/auto-complete/virtual-scroll.md @@ -37,7 +37,7 @@ In the following example, `text` column from complex data have been mapped to th ## Binding remote data -The AutoComplete supports the retrieval of data from remote data services with the help of the `DataManager` component, triggering the `actionBegin` and `actionComplete` events, and then updating the list data. During virtual scrolling, additional data is retrieved from the server, triggering the `actionBegin` and `actionComplete` events at that time as well. +The AutoComplete component supports the retrieval of data from remote data services with the help of the `DataManager` component, triggering the `actionBegin` and `actionComplete` events, and then updating the list data. During virtual scrolling, additional data is retrieved from the server, triggering the `actionBegin` and `actionComplete` events at that time as well. The following sample displays the OrderId from the `Orders` Data Service. @@ -52,9 +52,26 @@ The following sample displays the OrderId from the `Orders` Data Service. {% previewsample "page.domainurl/code-snippet/auto-complete/virtual-scroll-remote" %} +## Customizing items count in virtualization + +When the `enableVirtualization` property is enabled, the `take` property provided by the user within the Query parameter at the initial state or during the `actionBegin` event will be considered. Internally, it calculates the items that fit onto the current page (i.e., probably twice the amount of the popup's height). If the user-provided take value is less than the minimum number of items that fit into the popup, the user-provided take value will not be considered. + +The following sample shows the example for Customizing items count in virtualization. + +{% tabs %} +{% highlight html tabtitle="Composition API (~/src/App.vue)" %} +{% include code-snippet/auto-complete/virtual-scroll-remote/app-composition.vue %} +{% endhighlight %} +{% highlight html tabtitle="Options API (~/src/App.vue)" %} +{% include code-snippet/auto-complete/virtual-scroll-remote/app.vue %} +{% endhighlight %} +{% endtabs %} + +{% previewsample "page.domainurl/code-snippet/auto-complete/virtual-scroll-remote" %} + ## Grouping -The AutoComplete component supports grouping with Virtualization. It allows you to organize elements into groups based on different categories. Each item in the list can be classified using the [groupBy](../api/auto-complete/#fields) field in the data table. After grouping, virtualization works similarly to local data binding, providing a seamless user experience. When the data source is bound to remote data, an initial request is made to retrieve all data for the purpose of grouping. Subsequently, the grouped data works in the same way as local data binding virtualization, enhancing performance and responsiveness. +The AutoComplete supports grouping with Virtualization. It allows you to organize elements into groups based on different categories. Each item in the list can be classified using the [groupBy](../api/auto-complete/#fields) field in the data table. After grouping, virtualization works similarly to local data binding, providing a seamless user experience. When the data source is bound to remote data, an initial request is made to retrieve all data for the purpose of grouping. Subsequently, the grouped data works in the same way as local data binding virtualization, enhancing performance and responsiveness. The following sample shows the example for Grouping with Virtualization. diff --git a/ej2-vue/code-snippet/auto-complete/virtual-scroll-items/app-composition.vue b/ej2-vue/code-snippet/auto-complete/virtual-scroll-items/app-composition.vue new file mode 100644 index 000000000..8caa1ed66 --- /dev/null +++ b/ej2-vue/code-snippet/auto-complete/virtual-scroll-items/app-composition.vue @@ -0,0 +1,55 @@ + + + diff --git a/ej2-vue/code-snippet/auto-complete/virtual-scroll-items/app.vue b/ej2-vue/code-snippet/auto-complete/virtual-scroll-items/app.vue new file mode 100644 index 000000000..5a5a33adb --- /dev/null +++ b/ej2-vue/code-snippet/auto-complete/virtual-scroll-items/app.vue @@ -0,0 +1,66 @@ + + + diff --git a/ej2-vue/code-snippet/auto-complete/virtual-scroll-items/index.css b/ej2-vue/code-snippet/auto-complete/virtual-scroll-items/index.css new file mode 100644 index 000000000..5ecb7207e --- /dev/null +++ b/ej2-vue/code-snippet/auto-complete/virtual-scroll-items/index.css @@ -0,0 +1,14 @@ + + + + +#wrapper1{ + min-width: 250px; + float: left; + margin-left: 100px; +} +#wrapper2{ + min-width: 250px; + float: right; + margin-right: 100px; +} diff --git a/ej2-vue/code-snippet/auto-complete/virtual-scroll-items/index.html b/ej2-vue/code-snippet/auto-complete/virtual-scroll-items/index.html new file mode 100644 index 000000000..303d777bf --- /dev/null +++ b/ej2-vue/code-snippet/auto-complete/virtual-scroll-items/index.html @@ -0,0 +1,23 @@ + + + + + + + EJ2 Vue Sample + + + + + + + + + + + +
Loading....
+ + + + diff --git a/ej2-vue/code-snippet/auto-complete/virtual-scroll-items/index.js b/ej2-vue/code-snippet/auto-complete/virtual-scroll-items/index.js new file mode 100644 index 000000000..ecae1b90d --- /dev/null +++ b/ej2-vue/code-snippet/auto-complete/virtual-scroll-items/index.js @@ -0,0 +1,37 @@ + +import Vue from 'vue'; +import { DropDownListPlugin } from '@syncfusion/ej2-vue-dropdowns'; +import { DropDownList, VirtulScroll } from '@syncfusion/ej2-dropdowns'; +DropDownList.Inject(VirtulScroll); +Vue.use(DropDownListPlugin); +let records = []; +function dataSource() { + for (let i = 1; i <= 150; i++) { + let item = { + id: 'id' + i, + text: "Item " + i, + }; + records.push(item); + } +} +dataSource(); + +new Vue({ + el: '#app', + template: ` +
+
+ +
+
+`, + + name: 'app', + data () { + return { + itemData: records, + fields: { value: 'id', text: 'text' } + } + } + +}); \ No newline at end of file diff --git a/ej2-vue/code-snippet/auto-complete/virtual-scroll-items/systemjs.config.js b/ej2-vue/code-snippet/auto-complete/virtual-scroll-items/systemjs.config.js new file mode 100644 index 000000000..59e29f29e --- /dev/null +++ b/ej2-vue/code-snippet/auto-complete/virtual-scroll-items/systemjs.config.js @@ -0,0 +1,39 @@ +System.config({ + transpiler: "typescript", + typescriptOptions: { + compilerOptions: { + target: "umd", + module: "commonjs", + moduleResolution: "node", + emitDecoratorMetadata: true, + experimentalDecorators: true + } + }, + paths: { + "syncfusion:": "https://cdn.syncfusion.com/ej2/20.3.56/" + }, + map: { + typescript: "https://unpkg.com/typescript@2.2.2/lib/typescript.js", +vue: "https://unpkg.com/vue@2.6.14/dist/vue.min.js", + "@syncfusion/ej2-base": "syncfusion:ej2-base/dist/ej2-base.umd.min.js", + "@syncfusion/ej2-data": "syncfusion:ej2-data/dist/ej2-data.umd.min.js", + "@syncfusion/ej2-buttons": "syncfusion:ej2-buttons/dist/ej2-buttons.umd.min.js", + "@syncfusion/ej2-splitbuttons": "syncfusion:ej2-splitbuttons/dist/ej2-splitbuttons.umd.min.js", + "@syncfusion/ej2-lists": "syncfusion:ej2-lists/dist/ej2-lists.umd.min.js", + "@syncfusion/ej2-dropdowns": "syncfusion:ej2-dropdowns/dist/ej2-dropdowns.umd.min.js", + "@syncfusion/ej2-notifications":"syncfusion:ej2-notifications/dist/ej2-notifications.umd.min.js", + "@syncfusion/ej2-notifications": "syncfusion:ej2-notifications/dist/ej2-notifications.umd.min.js", + "@syncfusion/ej2-navigations": "syncfusion:ej2-navigations/dist/ej2-navigations.umd.min.js", + "@syncfusion/ej2-popups": "syncfusion:ej2-popups/dist/ej2-popups.umd.min.js", + "@syncfusion/ej2-inputs": "syncfusion:ej2-inputs/dist/ej2-inputs.umd.min.js", + "@syncfusion/ej2-vue-base": "syncfusion:ej2-vue-base/dist/ej2-vue-base.umd.min.js", + "@syncfusion/ej2-vue-buttons": "syncfusion:ej2-vue-buttons/dist/ej2-vue-buttons.umd.min.js", + "@syncfusion/ej2-vue-lists": "syncfusion:ej2-vue-lists/dist/ej2-vue-lists.umd.min.js", + "@syncfusion/ej2-vue-dropdowns": "syncfusion:ej2-vue-dropdowns/dist/ej2-vue-dropdowns.umd.min.js", + "@syncfusion/ej2-vue-notifications": "syncfusion:ej2-vue-notifications/dist/ej2-vue-notifications.umd.min.js", + "@syncfusion/ej2-vue-popups": "syncfusion:ej2-vue-popups/dist/ej2-vue-popups.umd.min.js", + "@syncfusion/ej2-vue-inputs": "syncfusion:ej2-vue-inputs/dist/ej2-vue-inputs.umd.min.js", + } +}); + +System.import('index.js'); \ No newline at end of file diff --git a/ej2-vue/code-snippet/combobox/virtual-scroll-items/app-composition.vue b/ej2-vue/code-snippet/combobox/virtual-scroll-items/app-composition.vue new file mode 100644 index 000000000..4934b0ed2 --- /dev/null +++ b/ej2-vue/code-snippet/combobox/virtual-scroll-items/app-composition.vue @@ -0,0 +1,55 @@ + + + diff --git a/ej2-vue/code-snippet/combobox/virtual-scroll-items/app.vue b/ej2-vue/code-snippet/combobox/virtual-scroll-items/app.vue new file mode 100644 index 000000000..67262aeb3 --- /dev/null +++ b/ej2-vue/code-snippet/combobox/virtual-scroll-items/app.vue @@ -0,0 +1,66 @@ + + + diff --git a/ej2-vue/code-snippet/combobox/virtual-scroll-items/index.css b/ej2-vue/code-snippet/combobox/virtual-scroll-items/index.css new file mode 100644 index 000000000..5ecb7207e --- /dev/null +++ b/ej2-vue/code-snippet/combobox/virtual-scroll-items/index.css @@ -0,0 +1,14 @@ + + + + +#wrapper1{ + min-width: 250px; + float: left; + margin-left: 100px; +} +#wrapper2{ + min-width: 250px; + float: right; + margin-right: 100px; +} diff --git a/ej2-vue/code-snippet/combobox/virtual-scroll-items/index.html b/ej2-vue/code-snippet/combobox/virtual-scroll-items/index.html new file mode 100644 index 000000000..303d777bf --- /dev/null +++ b/ej2-vue/code-snippet/combobox/virtual-scroll-items/index.html @@ -0,0 +1,23 @@ + + + + + + + EJ2 Vue Sample + + + + + + + + + + + +
Loading....
+ + + + diff --git a/ej2-vue/code-snippet/combobox/virtual-scroll-items/index.js b/ej2-vue/code-snippet/combobox/virtual-scroll-items/index.js new file mode 100644 index 000000000..ecae1b90d --- /dev/null +++ b/ej2-vue/code-snippet/combobox/virtual-scroll-items/index.js @@ -0,0 +1,37 @@ + +import Vue from 'vue'; +import { DropDownListPlugin } from '@syncfusion/ej2-vue-dropdowns'; +import { DropDownList, VirtulScroll } from '@syncfusion/ej2-dropdowns'; +DropDownList.Inject(VirtulScroll); +Vue.use(DropDownListPlugin); +let records = []; +function dataSource() { + for (let i = 1; i <= 150; i++) { + let item = { + id: 'id' + i, + text: "Item " + i, + }; + records.push(item); + } +} +dataSource(); + +new Vue({ + el: '#app', + template: ` +
+
+ +
+
+`, + + name: 'app', + data () { + return { + itemData: records, + fields: { value: 'id', text: 'text' } + } + } + +}); \ No newline at end of file diff --git a/ej2-vue/code-snippet/combobox/virtual-scroll-items/systemjs.config.js b/ej2-vue/code-snippet/combobox/virtual-scroll-items/systemjs.config.js new file mode 100644 index 000000000..59e29f29e --- /dev/null +++ b/ej2-vue/code-snippet/combobox/virtual-scroll-items/systemjs.config.js @@ -0,0 +1,39 @@ +System.config({ + transpiler: "typescript", + typescriptOptions: { + compilerOptions: { + target: "umd", + module: "commonjs", + moduleResolution: "node", + emitDecoratorMetadata: true, + experimentalDecorators: true + } + }, + paths: { + "syncfusion:": "https://cdn.syncfusion.com/ej2/20.3.56/" + }, + map: { + typescript: "https://unpkg.com/typescript@2.2.2/lib/typescript.js", +vue: "https://unpkg.com/vue@2.6.14/dist/vue.min.js", + "@syncfusion/ej2-base": "syncfusion:ej2-base/dist/ej2-base.umd.min.js", + "@syncfusion/ej2-data": "syncfusion:ej2-data/dist/ej2-data.umd.min.js", + "@syncfusion/ej2-buttons": "syncfusion:ej2-buttons/dist/ej2-buttons.umd.min.js", + "@syncfusion/ej2-splitbuttons": "syncfusion:ej2-splitbuttons/dist/ej2-splitbuttons.umd.min.js", + "@syncfusion/ej2-lists": "syncfusion:ej2-lists/dist/ej2-lists.umd.min.js", + "@syncfusion/ej2-dropdowns": "syncfusion:ej2-dropdowns/dist/ej2-dropdowns.umd.min.js", + "@syncfusion/ej2-notifications":"syncfusion:ej2-notifications/dist/ej2-notifications.umd.min.js", + "@syncfusion/ej2-notifications": "syncfusion:ej2-notifications/dist/ej2-notifications.umd.min.js", + "@syncfusion/ej2-navigations": "syncfusion:ej2-navigations/dist/ej2-navigations.umd.min.js", + "@syncfusion/ej2-popups": "syncfusion:ej2-popups/dist/ej2-popups.umd.min.js", + "@syncfusion/ej2-inputs": "syncfusion:ej2-inputs/dist/ej2-inputs.umd.min.js", + "@syncfusion/ej2-vue-base": "syncfusion:ej2-vue-base/dist/ej2-vue-base.umd.min.js", + "@syncfusion/ej2-vue-buttons": "syncfusion:ej2-vue-buttons/dist/ej2-vue-buttons.umd.min.js", + "@syncfusion/ej2-vue-lists": "syncfusion:ej2-vue-lists/dist/ej2-vue-lists.umd.min.js", + "@syncfusion/ej2-vue-dropdowns": "syncfusion:ej2-vue-dropdowns/dist/ej2-vue-dropdowns.umd.min.js", + "@syncfusion/ej2-vue-notifications": "syncfusion:ej2-vue-notifications/dist/ej2-vue-notifications.umd.min.js", + "@syncfusion/ej2-vue-popups": "syncfusion:ej2-vue-popups/dist/ej2-vue-popups.umd.min.js", + "@syncfusion/ej2-vue-inputs": "syncfusion:ej2-vue-inputs/dist/ej2-vue-inputs.umd.min.js", + } +}); + +System.import('index.js'); \ No newline at end of file diff --git a/ej2-vue/code-snippet/drop-down-list/virtual-scroll-items/app-composition.vue b/ej2-vue/code-snippet/drop-down-list/virtual-scroll-items/app-composition.vue new file mode 100644 index 000000000..aee72f57c --- /dev/null +++ b/ej2-vue/code-snippet/drop-down-list/virtual-scroll-items/app-composition.vue @@ -0,0 +1,55 @@ + + + diff --git a/ej2-vue/code-snippet/drop-down-list/virtual-scroll-items/app.vue b/ej2-vue/code-snippet/drop-down-list/virtual-scroll-items/app.vue new file mode 100644 index 000000000..c3e38fe7b --- /dev/null +++ b/ej2-vue/code-snippet/drop-down-list/virtual-scroll-items/app.vue @@ -0,0 +1,66 @@ + + + diff --git a/ej2-vue/code-snippet/drop-down-list/virtual-scroll-items/index.css b/ej2-vue/code-snippet/drop-down-list/virtual-scroll-items/index.css new file mode 100644 index 000000000..5ecb7207e --- /dev/null +++ b/ej2-vue/code-snippet/drop-down-list/virtual-scroll-items/index.css @@ -0,0 +1,14 @@ + + + + +#wrapper1{ + min-width: 250px; + float: left; + margin-left: 100px; +} +#wrapper2{ + min-width: 250px; + float: right; + margin-right: 100px; +} diff --git a/ej2-vue/code-snippet/drop-down-list/virtual-scroll-items/index.html b/ej2-vue/code-snippet/drop-down-list/virtual-scroll-items/index.html new file mode 100644 index 000000000..303d777bf --- /dev/null +++ b/ej2-vue/code-snippet/drop-down-list/virtual-scroll-items/index.html @@ -0,0 +1,23 @@ + + + + + + + EJ2 Vue Sample + + + + + + + + + + + +
Loading....
+ + + + diff --git a/ej2-vue/code-snippet/drop-down-list/virtual-scroll-items/index.js b/ej2-vue/code-snippet/drop-down-list/virtual-scroll-items/index.js new file mode 100644 index 000000000..ecae1b90d --- /dev/null +++ b/ej2-vue/code-snippet/drop-down-list/virtual-scroll-items/index.js @@ -0,0 +1,37 @@ + +import Vue from 'vue'; +import { DropDownListPlugin } from '@syncfusion/ej2-vue-dropdowns'; +import { DropDownList, VirtulScroll } from '@syncfusion/ej2-dropdowns'; +DropDownList.Inject(VirtulScroll); +Vue.use(DropDownListPlugin); +let records = []; +function dataSource() { + for (let i = 1; i <= 150; i++) { + let item = { + id: 'id' + i, + text: "Item " + i, + }; + records.push(item); + } +} +dataSource(); + +new Vue({ + el: '#app', + template: ` +
+
+ +
+
+`, + + name: 'app', + data () { + return { + itemData: records, + fields: { value: 'id', text: 'text' } + } + } + +}); \ No newline at end of file diff --git a/ej2-vue/code-snippet/drop-down-list/virtual-scroll-items/systemjs.config.js b/ej2-vue/code-snippet/drop-down-list/virtual-scroll-items/systemjs.config.js new file mode 100644 index 000000000..59e29f29e --- /dev/null +++ b/ej2-vue/code-snippet/drop-down-list/virtual-scroll-items/systemjs.config.js @@ -0,0 +1,39 @@ +System.config({ + transpiler: "typescript", + typescriptOptions: { + compilerOptions: { + target: "umd", + module: "commonjs", + moduleResolution: "node", + emitDecoratorMetadata: true, + experimentalDecorators: true + } + }, + paths: { + "syncfusion:": "https://cdn.syncfusion.com/ej2/20.3.56/" + }, + map: { + typescript: "https://unpkg.com/typescript@2.2.2/lib/typescript.js", +vue: "https://unpkg.com/vue@2.6.14/dist/vue.min.js", + "@syncfusion/ej2-base": "syncfusion:ej2-base/dist/ej2-base.umd.min.js", + "@syncfusion/ej2-data": "syncfusion:ej2-data/dist/ej2-data.umd.min.js", + "@syncfusion/ej2-buttons": "syncfusion:ej2-buttons/dist/ej2-buttons.umd.min.js", + "@syncfusion/ej2-splitbuttons": "syncfusion:ej2-splitbuttons/dist/ej2-splitbuttons.umd.min.js", + "@syncfusion/ej2-lists": "syncfusion:ej2-lists/dist/ej2-lists.umd.min.js", + "@syncfusion/ej2-dropdowns": "syncfusion:ej2-dropdowns/dist/ej2-dropdowns.umd.min.js", + "@syncfusion/ej2-notifications":"syncfusion:ej2-notifications/dist/ej2-notifications.umd.min.js", + "@syncfusion/ej2-notifications": "syncfusion:ej2-notifications/dist/ej2-notifications.umd.min.js", + "@syncfusion/ej2-navigations": "syncfusion:ej2-navigations/dist/ej2-navigations.umd.min.js", + "@syncfusion/ej2-popups": "syncfusion:ej2-popups/dist/ej2-popups.umd.min.js", + "@syncfusion/ej2-inputs": "syncfusion:ej2-inputs/dist/ej2-inputs.umd.min.js", + "@syncfusion/ej2-vue-base": "syncfusion:ej2-vue-base/dist/ej2-vue-base.umd.min.js", + "@syncfusion/ej2-vue-buttons": "syncfusion:ej2-vue-buttons/dist/ej2-vue-buttons.umd.min.js", + "@syncfusion/ej2-vue-lists": "syncfusion:ej2-vue-lists/dist/ej2-vue-lists.umd.min.js", + "@syncfusion/ej2-vue-dropdowns": "syncfusion:ej2-vue-dropdowns/dist/ej2-vue-dropdowns.umd.min.js", + "@syncfusion/ej2-vue-notifications": "syncfusion:ej2-vue-notifications/dist/ej2-vue-notifications.umd.min.js", + "@syncfusion/ej2-vue-popups": "syncfusion:ej2-vue-popups/dist/ej2-vue-popups.umd.min.js", + "@syncfusion/ej2-vue-inputs": "syncfusion:ej2-vue-inputs/dist/ej2-vue-inputs.umd.min.js", + } +}); + +System.import('index.js'); \ No newline at end of file diff --git a/ej2-vue/code-snippet/multi-select/virtual-scroll-items/app-composition.vue b/ej2-vue/code-snippet/multi-select/virtual-scroll-items/app-composition.vue index faeb673f5..58fc5f96c 100644 --- a/ej2-vue/code-snippet/multi-select/virtual-scroll-items/app-composition.vue +++ b/ej2-vue/code-snippet/multi-select/virtual-scroll-items/app-composition.vue @@ -26,12 +26,12 @@ dataSource(); const itemData = records; const fields = { value: 'id', text: 'text' }; const allowFiltering = true; -const query = new Query().take(20); +const query = new Query().take(40); provide('multiselect', [VirtualScroll]); const actionBegin = function (e) { - e.query = new Query().take(25); + e.query = new Query().take(45); } diff --git a/ej2-vue/code-snippet/multi-select/virtual-scroll-items/app.vue b/ej2-vue/code-snippet/multi-select/virtual-scroll-items/app.vue index 2b687b7f4..074e0e7f4 100644 --- a/ej2-vue/code-snippet/multi-select/virtual-scroll-items/app.vue +++ b/ej2-vue/code-snippet/multi-select/virtual-scroll-items/app.vue @@ -33,7 +33,7 @@ export default { itemData: records, fields: { value: 'id', text: 'text' }, allowFiltering: true, - query: new Query().take(20), + query: new Query().take(40), } }, provide: { @@ -41,7 +41,7 @@ export default { }, methods: { actionBegin: function (e) { - e.query = new Query().take(25); + e.query = new Query().take(45); } } } diff --git a/ej2-vue/code-snippet/multi-select/virtual-scroll-remote/app-composition.vue b/ej2-vue/code-snippet/multi-select/virtual-scroll-remote/app-composition.vue index b182910d6..b043aea14 100644 --- a/ej2-vue/code-snippet/multi-select/virtual-scroll-remote/app-composition.vue +++ b/ej2-vue/code-snippet/multi-select/virtual-scroll-remote/app-composition.vue @@ -9,11 +9,11 @@