Hi,
Thank you for the code snippets.
The loading of a local JSON data file in the Kendo UI DataSource component could be implemented as follows:
- Format the JSON data as JSON Array (array of JSON objects)
var localData = [
{
"property1": "test value",
"property2": test value 2
}, { ... } ];
2. Include the file on the HTML page:
<script type="text/javascript" src="fileName.json"></script>
3. Update the "transport'' configuration of the data source by specifying the "url" to point to the location of the data (the JSON Array):
dataSource: {
transport:{
url: localData,
type: "json",
read: function (e) {
e.success(localData);
}
},
...
}
Would you please give a try of this example and let me know if it works properly at your end?
Feel free to let me know if you need any further assistance.
Regards,
Mihaela Lukanova
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.