We have a Vuejs app that is using the Kendo DropDownTree control, with checkboxes, to display a hierarchy of data.
The problem is, there is a difference with how the control returns the checked IDs when the parent node is expanded VS collapsed.
To illustrate the problem:_parent1
Is there a way to get all the checked IDs from "$event.sender._values" whenever any node is checked?
Here is how my dropdowntree is configured along with the change function:
<dropdowntree
A number of Kendo components could do with better support for screen readers, including:
No doubt there are more than the above.
Effective screen reader accessibility is as much about what you skip as what you add. Where possible, audio prompts should be short and clear, and not produce excess noise.
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?
1
1
SAMPLE https://stackblitz.com/edit/usjgwp?file=index.html
I want to show a number of kendo dropdownlist(s) on a page. The exact number depends on an API call. This API call will give me an array of objects. The objects have the following properties: Id, name, type, role and isSelected.
The number of dropdownlist that has to be shown on this page should be equal to the number of unique type values in the API response array. i.e, numberOfDropdowns = stakeholders.map(a => a.type).distinct().count().
Now, each dropdown will have a datasource based on the type property. i.e, For a dropdown for type = 1, dataSource will be stakeholders.filter(s => s.type == 1).
Also the default values in the dropdowns will be based on the isSelected property. For every type, only one object will have isSelected = true.
I have achieved these things by using the following code:
01.
<
template
>
02.
<
div
03.
v-if="selectedStakeholders.length > 0"
04.
v-for="(stakeholderLabel, index) in stakeholderLabels"
05.
:key="stakeholderLabel.Key"
06.
>
07.
<
label
>{{ stakeholderLabel.Value }}:</
label
>
08.
<
kendo-dropdownlist
09.
v-model
=
"selectedStakeholders[index].Id"
10.
:data-source="stakeholders.filter(s => s.type == stakeholderLabel.Key)"
11.
data-text-field="name"
12.
data-value-field="Id"
13.
></
kendo-dropdownlist
>
14.
15.
<
button
@
click
=
"updateStakeholders"
>Update form</
button
>
16.
</
div
>
17.
</
template
>
18.
19.
<
script
>
20.
import STAKEHOLDER_SERVICE from "somePath";
21.
export default {
22.
name: "someName",
23.
props: {
24.
value1: String,
25.
value2: String,
26.
},
27.
data() {
28.
return {
29.
payload: {
30.
value1: this.value1,
31.
value2: this.value2
32.
},
33.
stakeholders: [],
34.
selectedStakeholders: [],
35.
stakeholderLabels: [] // [{Key: 1, Value: "Stakeholder1"}, {Key: 2, Value: "Stakeholder2"}, ... ]
36.
};
37.
},
38.
mounted: async function() {
39.
await this.setStakeholderLabels();
40.
await this.setStakeholderDataSource();
41.
this.setSelectedStakeholdersArray();
42.
},
43.
methods: {
44.
async setStakeholderLabels() {
45.
let kvPairs = await STAKEHOLDER_SERVICE.getStakeholderLabels();
46.
kvPairs = kvPairs.sort((kv1, kv2) => (kv1.Key > kv2.Key ? 1 : -1));
47.
kvPairs.forEach(kvPair => this.stakeholderLabels.push(kvPair));
48.
},
49.
async setStakeholderDataSource() {
50.
this.stakeholders = await STAKEHOLDER_SERVICE.getStakeholders(
51.
this.payload
52.
);
53.
}
54.
setSelectedStakeholdersArray() {
55.
const selectedStakeholders = this.stakeholders
56.
.filter(s => s.isSelected === true)
57.
.sort((s1, s2) => (s1.type > s2.type ? 1 : -1));
58.
59.
selectedStakeholders.forEach(selectedStakeholder =>
60.
this.selectedStakeholders.push(selectedStakeholder)
61.
);
62.
},
63.
async updateStakeholders() {
64.
console.log(this.selectedStakeholders);
65.
}
66.
}
67.
};
68.
</
script
>
The problem is that I am not able to change the selection in the dropdownlist the selection always remains the same as the default selected values. Even when I choose a different option in any dropdownlist, the selection does not actually change.
I've also tried binding like this:
1.
<
kendo-dropdownlist
2.
v-model
=
"selectedStakeholders[index]"
3.
value-primitive
=
"false"
4.
:data-source="stakeholders.filter(s => s.type == stakeholderLabel.Key)"
5.
data-text-field="name"
6.
data-value-field="Id"
7.
></
kendo-dropdownlist
>
If I bind like this, I am able to change selection but then the default selection does not happen, the first option is always the selection option i.e, default selection is not based on the isSelectedproperty.
My requirement is that I have to show the dropdown with some default selections, allow the user to choose different options in all the different dropdowns and then retrieve all the selection then the update button is clicked.
UPDATE: When I use the first method for binding, The Id property of objects in the selectedStakeholders array is actually changing, but it does not reflect on the UI, i.e, on the UI, the selected option is always the default option even when user changes selection. Also when I subscribe to the change and select events, I see that only select event is being triggered, change event never triggers.
Hi There, I have a kendo UI chart who's datasource is bound to a computed property. I can see the datasource computed property is being updated but the chart is not rebinding/redrawing. Do I need to manually redraw the chart?
If we don't need to manually refresh/redraw then do you have any ideas as to why the chart wouldn't redraw when I update the datasource prop? Thanks!
On most Native Kendo Vue components the following classes are applied depending on the state:
'k-state-invalid' for instance adds a red border around the Kendo Input component:
In this example the red line isn't added to the html textarea:
https://www.telerik.com/kendo-vue-ui/components/form/guidelines-with-examples/#toc-vue-form-inputs
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?
Hello , I would like to add a class to the ChartSeriesItem, the hand cursor pointer :
This is my code :
Hello,
We have implemented Kendo Vue Donut chart, using visual function, that in most cases rendered well.
But we found that on certain devices (regardless bigger or smaller) the chart renders each slice of the donut as a full circle and puts them all one on top of the other. The attached image demonstrates it.
Our investigation shows that it is the result of the seriesDefaults holeSize value AND the visual function stroke line width.
Both are determined programmatically at run time.
The following values result with the correct donut you see in the image:
holeSize: 83
visual stroke width: 22 (or less)
And the following values result with the incorrect donut:
holeSize: 83
visual stroke width: 23 (or more)
Notice it is also related to the holeSize - for example the following will be rendered well:
holeSize: 85
visual stroke width: 23 (or more)
And holeSize 84 with visual stroke width of 23 is rendered incorrectly.
Can you please advise how we can make sure it will always be rendered correctly? Is there a certain ratio between the holeSize and the visual stroke width we need to maintain?
Thanks,
Ron.