is there any way I can configure a Kendo-UI DataSource for multiple elements (ListView, Grid, Charts) ??
Thanks for the help!
Related
I have to create the kendo ui tree list with two way data binding. I have try with the kendo grid which is working but for kendo tree list it is not working. Please let me know if i am missing anything.
Kendo grid example :- http://dojo.telerik.com/OvUxU/2
Kendo tree list example :- http://dojo.telerik.com/#vinay/arAwo
The TreeList is a bit different in this behavior due to how it process data related to load-on-demand. In order make this scenario work you should defined dataSource.data instead of directly dataSource as array.
Here is the updated example - http://dojo.telerik.com/#rusev/oJeho
I'm in a situation where I have two different Kendo UI Datasources, and they both contain a field called "ID".
Datasource1
Datasource2
Now I need to to the following:
First apply filter and group to Datasource 1 (this works fine)
Then populate a listView only with the items which has an ID that is also part of Datasource2
I tried doing this with a script in the listView template, but when items are "excluded" it outputs an empty li-element.
Any ideas?
I got help from Telerik support to solve this. Here is the solution they proposed:
As there is not built-in functionality that does the functionality that you are looking for, you will need to implement it manually. First you will need to filter the dataSource then loop through the results and get the items from the second dataSource with the ID that match the one you are looking for (using the get()) method. Then you can push the items in a new dataSource that you can use to show the ListView template.
It works great.
I'm using a custom popup editor in a detail grid (several fields are using data attribute initialization).
One of the fields is a Kendo DropDownList, but I need the options in the list to be filtered based on the value of one of the fields in the currently expanded master row.
I've managed a buggy workaround by setting a global variable when a master row is expanded and then filtering the dropdownlist's datasource using a function call on the open event.
I'm sure there must be a better way to do this. Is it possible to specify a datasource filter using data attribute initialization -- I can't see anything in the docs for this.
Thanks
Missed the obvious...
I just needed to filter the datasource for the drop down list in the grid's edit event.
I have used kendo grids and charts fine and refreshed them with the following example code:
$("#Product").data("kendoGrid").dataSource.read();
However, I have used the datasource just to provide some basic data in a different view, like in this example where it does not use the grid http://demos.kendoui.com/web/datasource/index.html
Is there a way to refresh this datasource in the same kind of way as the above code does for the grids and charts?
Thanks, Matt
It seems to be that only the data is read with dataSource, you need to refresh the grid also like this:
$("#Product").data("kendoGrid").dataSource.read();
$("#Product").data("kendoGrid").refresh();
If I create several grids, how do I set the dataView.setFilter(filter) for each grid?
Currently when I apply dataView.Setfilter(filter), it only collects data from the last grid I created even if I push each grid to an array and then apply setFilter to grid[i].
many thanks for your help
Are you creating a new DataView for each grid? You should be.
Any Grid initialized with a DataView in place of a plain array will allow you to access the specific DataView using grid.getData().
So to apply a filter to a specific DataView from your grid array you'd do:
grid[i].getData().setFilter(filter);