Hello,
I need to use a column filter with checkboxes on my current grid. I want the checkboxes to have values from all the possible data from the server instead of only the data that I got on the current page.
This means that when the column filter is getting open, I need to make a call to the server in order to get all the data I need.
Can you please provide me a way to do, because I can't find one.
Thanks
Nevermind, I solved it. I saw that there is a property dataItems. This raised another question. How can I make a loading animation for the dropdown while I m waiting to get my data?
Hi,
I have the native grid set up in my vue application with Vuex and having issue getting the grouping feature to work.
I am not getting a response whenever I drag a column to the column header. The dragged column just not stay in the column header, it disappears afterward.
It seems my grid isn't emitting the onDataStateChange method. Not sure what I have done wrong.
Other gird features are working fine.
<
template
>
<
v-card
shaped>
<
v-card-title
>
<
h3
>
Product
</
h3
>
</
v-card-title
>
<
v-card-text
>
<
Grid
:style
=
"{height: '800px'}"
:data-items
=
"gridDataResult"
:filterable
=
"true"
:filter
=
"filter"
:groupable
=
"true"
:group
=
"group"
:pageable
=
"pageable"
:reorderable
=
"true"
:resizable
=
"true"
:sortable
=
"true"
:sort
=
"sort"
:skip
=
"skip"
:take
=
"take"
:total
=
"total"
:expand-field
=
"'expanded'"
:columns
=
"columns"
:column-menu
=
"columnMenu"
@
pagechange
=
"pageChangeHandler"
@
filterchange
=
"filterChange"
@
sortchange
=
"sortChangeHandler"
@
dataStateChange
=
"dataStateChange"
@
expandchange
=
"expandChange"
@
columnreorder
=
"columnReorder"
>
<!-- <
grid-toolbar
>
<
button
title
=
"Add new"
class
=
"k-button k-primary"
@
click
=
"insert"
>
Add new
</
button
>
<
button
v-if
=
"hasItemsInEdit"
title
=
"Cancel current changes"
class
=
"k-button"
@
click
=
"cancelChanges"
>
Cancel current changes
</
button
>
</
grid-toolbar
> -->
<
grid-no-records
>
<
div
class
=
"k-loading-mask customPosition"
>
<
span
class
=
"k-loading-text"
/>
<
div
class
=
"k-loading-image"
/>
<
div
class
=
"k-loading-color"
/>
</
div
>
</
grid-no-records
>
</
Grid
>
</
v-card-text
>
</
v-card
>
</
template
>
<
script
>
import { process } from '@progress/kendo-data-query';
// import { mapGetters } from 'vuex';
// import { mapGetters, mapActions } from 'vuex';
export default {
name: 'Product',
components: {},
data() {
return {
columnMenu: false,
expandedItems: [],
gridPageable: { pageSizes: true },
skip: 0,
take: 10,
pageSize: 10,
pageable: {
buttonCount: 10,
info: true,
type: 'numeric',
pageSizes: true,
previousNext: true,
},
filter: {
logic: '',
filters: [
// { field: 'UnitPrice', operator: 'neq', value: 18 },
// { field: 'calendarMonth', operator: 'gte', value: new Date('1996-10-10') },
],
},
group: [],
sort: [{ field: 'id', dir: 'asc' }],
// sort: [
// { field: 'id', dir: 'asc' },
// ],
columns: [
{
field: 'id',
title: 'ID',
// width: '70px',
},
{
field: 'currency',
title: 'Currency',
// width: '100px',
},
{
field: 'salesOrigin',
title: 'Sales Origin',
// width: '100px',
// filter: 'numeric',
// groupable: true,
},
{
field: 'plant',
title: 'Plant',
// width: '100px',
// filter: 'numeric',
// groupable: true,
},
{
field: 'sku',
title: 'SKU',
// width: '100px',
// groupable: true,
},
{
field: 'materialGroupDescription',
title: 'Material Group Description',
// width: '100px',
},
{
field: 'materialDescription',
title: 'Material Description',
// width: '100px',
},
{
field: 'swatchDisplayColourDescription',
title: 'Colour',
// width: '100px',
},
{
field: 'calendarMonth',
filter: 'date',
title: 'Calendar Month',
// width: '100px',
// groupable: true,
},
{
field: 'discontinued',
title: 'Discontinued',
// filter: 'boolean',
// groupable: true,
},
// {
// command: [
// {
// name: 'edit',
// text: ' ',
// width: 10,
// },
// {
// name: 'destroy',
// text: ' ',
// width: 10,
// },
// ],
// title: 'Actions',
// // width: '150px',
// },
],
};
},
computed: {
gridDataResult: {
get() {
// const data = process(this.$store.getters.aggregatedBoDataList,
// {
// sort: this.sort,
// take: this.take,
// skip: this.skip,
// filter: this.filter,
// group: this.group,
// });
// console.log(data);
return process(this.$store.getters.aggregatedBoDataList,
{
take: this.take,
skip: this.skip,
sort: this.sort,
filter: this.filter,
group: this.group,
});
},
set(data) {
return process(data,
{
take: this.take,
skip: this.skip,
sort: this.sort,
filter: this.filter,
group: this.group,
});
},
},
total() {
return this.$store.getters.aggregatedBoDataList
? this.$store.getters.aggregatedBoDataList.length : 0;
},
},
created() {
this.$store.dispatch({
type: 'fetchAggregatedBoData',
count: 200,
});
},
methods: {
createAppState(dataState) {
console.log(`dataState ${dataState}`);
this.group = dataState.group;
this.take = dataState.take;
this.skip = dataState.skip;
this.girdDataResult(dataState.data);
// this.getData();
},
groupChange(event) {
console.log(event);
},
dataStateChange(event) {
console.log(`data state ${event}`);
this.createAppState(event.data);
},
expandChange(event) {
console.log(`expand state ${event.target.$props.expandField}`);
this.$set(event.dataItem, event.target.$props.expandField, event.value);
},
pageChangeHandler(event) {
this.skip = event.page.skip;
this.take = event.page.take;
},
sortChangeHandler(e) {
this.sort = e.sort;
},
filterChange(ev) {
this.filter = ev.filter;
},
columnReorder(options) {
this.columns = options.columns;
},
},
};
</
script
>
<
style
>
.customPosition { margin-top:100px}
</
style
>
I'm trying to build a simple grid with server paging, filtering and sorting, but I'm having trouble. Currently my grid is loading in all items from the server, when it should be loading just five. I think I previously had it loading just five, but it was always getting the first five.
Here's my HTML:
<
div
id
=
"vueapp"
class
=
"vue-app"
>
<
kendo-datasource
ref
=
"datasource1"
:transport-read-url
=
"'https://demos.telerik.com/kendo-ui/service/Products'"
:transport-read-data-type
=
"'jsonp'"
:transport-update-url
=
"'https://demos.telerik.com/kendo-ui/service/Products/Update'"
:transport-update-data-type
=
"'jsonp'"
:transport-destroy-url
=
"'https://demos.telerik.com/kendo-ui/service/Products/Destroy'"
:transport-destroy-data-type
=
"'jsonp'"
:transport-create-url
=
"'https://demos.telerik.com/kendo-ui/service/Products/Create'"
:transport-create-data-type
=
"'jsonp'"
:transport-parameter-map
=
"parameterMap"
:server-paging
=
"true"
:page-size
=
'5'
>
</
kendo-datasource
>
<
kendo-grid
:height
=
"600"
:data-source-ref
=
"'datasource1'"
:pageable
=
'true'
:editable
=
"'inline'"
:page-size
=
'5'
:toolbar
=
"['create']"
>
<
kendo-grid-column
field
=
"ProductName"
></
kendo-grid-column
>
<
kendo-grid-column
field
=
"UnitPrice"
title
=
"Unit Price"
:width
=
"120"
:format
=
"'{0:c}'"
></
kendo-grid-column
>
<
kendo-grid-column
field
=
"UnitsInStock"
title
=
"Units In Stock"
:width
=
"120"
></
kendo-grid-column
>
<
kendo-grid-column
field
=
"Discontinued"
:width
=
"120"
:editor
=
"customBoolEditor"
></
kendo-grid-column
>
<
kendo-grid-column
:command
=
"['edit', 'destroy']"
title
=
" "
width
=
"170px"
></
kendo-grid-column
>
</
kendo-grid
>
</
div
>
And here's my JS (using webpack):
Vue.use(GridInstaller);
Vue.use(DataSourceInstaller);
new
Vue({
el:
'#vueapp'
,
data: {
schemaModelFields: {
ProductID: { editable:
false
, nullable:
true
},
ProductName: { validation: { required:
true
} },
UnitPrice: { type:
'number'
, validation: { required:
true
, min: 1 } },
Discontinued: { type:
'boolean'
},
UnitsInStock: { type:
'number'
, validation: { min: 0, required:
true
} }
}
},
methods: {
customBoolEditor:
function
(container, options) {
kendo.jQuery(
'<input class="k-checkbox" type="checkbox" name="Discontinued" data-type="boolean" data-bind="checked:Discontinued">'
).appendTo(container)
kendo.jQuery(
'<label class="k-checkbox-label"></label>'
).appendTo(container)
},
parameterMap:
function
(options, operation) {
if
(operation !==
'read'
&& options.models) {
return
{ models: kendo.stringify(options.models) }
}
}
}
})
Am I doing something wrong, or is this functionality not supported yet?
We are using the kendo-ui Dropdowntree control in our VueJS app.
If we have around 1100+ rows of data in our hierarchy, we find that the Browser screen freezes until the Dropdowntree control is finished populating.
Most of our hierarchies are much smaller and the control populates quickly as expected.
But we have 1135 rows in our hierarchy in one of our examples. The data is fetched from our API and returned to our Vuejs app, in a few seconds. But after the Vuejs load function finishes and the code is about to return to the UI, the screen freezes for about 10 seconds while the Dropdowntree control is populating. Nothing can be clicked while the screen is frozen.
How can we avoid the screen freezing while the Dropdowntree control is populating where the hierarchy rows are large?
Hi,
I am using Kendo UI Material theme. I would like to switch between light and dark themes without reloading the whole site. May I know what are variables available that I can set in the code?