Hello,
I am trying to implement custom rules for validator, where we need to make certain input fields mandatory only when a check box is selected. But not able to get it to work, can you please point out if i missed out anything in below -
var validator = $("#form1").kendoValidator({ errorTemplate: "<span></span>", validate: function (e) { var html = ""; e.preventDefault(); if (!e.valid) { var errors = this.errors(); var requiredFieldCount = 0; html += "<ul>"; for (var i = 0; i < errors.length; i++) { if (errors[i].toLowerCase().indexOf("required") > 0 && requiredFieldCount == 0) { html += "<li> Please enter mandatory Fields *</li>"; requiredFieldCount++; } else if (errors[i].toLowerCase().indexOf("required") < 0) { html += "<li>" + errors[i] + "</li>"; } } html += "</ul>"; } $("#errors").html($(html)); } }).data("kendoValidator");
Custom Rule -
$(function () {
var container = $("#form1");
kendo.init(container);
container.kendoValidator({
rules: {
InsuranceAmount: function (input) {
if (input.context.id == "" && input.val() != "") {
return $("#.HasInsurance:checked");
}
return true;
}
}
});
});
We are having issues losing cell edits when using Sortables with Grids. Kendos own Sortable+Grid demo shows the issue if you switch on editable:
http://demos.telerik.com/kendo-ui/sortable/integration-grid
Here is the same demo with editable switched on:
http://dojo.telerik.com/EFEVE
To reproduce the problem click in a cell and edit it, then click in another cell. The edits you made in the first cell will be lost.
If you disable the Sortable then this issue doesn't occur.
Hi Guys,
I am having a bit of trouble binding the treeview to some JSON returned by a REST datasource. The JSON looks like this:
{ "Links": { }, "Items": [ { "WebId": "E0PDGvCF_JoUerHmn03UKDRg4BjcATte5RGJsgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcR0FTMQ", "Id": "01dc18e0-5e3b-11e5-89b2-005056b23c22", "Name": "Gas1", "Description": "", "Path": "\\\\Global AF Acceptance Environment\\Company\\Gas1", "TemplateName": "Gas", "CategoryNames": [], "Links": { "Attributes": "https://DEVSEAT/piwebapi/elements/E0PDGvCF_JoUerHmn03UKDRg4BjcATte5RGJsgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcR0FTMQ/attributes", "Categories": "https://DEVSEAT/piwebapi/elements/E0PDGvCF_JoUerHmn03UKDRg4BjcATte5RGJsgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcR0FTMQ/categories", "EventFrames": "https://DEVSEAT/piwebapi/elements/E0PDGvCF_JoUerHmn03UKDRg4BjcATte5RGJsgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcR0FTMQ/eventframes", "InterpolatedData": "https://DEVSEAT/piwebapi/streamsets/E0PDGvCF_JoUerHmn03UKDRg4BjcATte5RGJsgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcR0FTMQ/interpolated", "RecordedData": "https://DEVSEAT/piwebapi/streamsets/E0PDGvCF_JoUerHmn03UKDRg4BjcATte5RGJsgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcR0FTMQ/recorded", "SummaryData": "https://DEVSEAT/piwebapi/streamsets/E0PDGvCF_JoUerHmn03UKDRg4BjcATte5RGJsgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcR0FTMQ/summary", } }, { "WebId": "E0PDGvCF_JoUerHmn03UKDRgoJxXIDte5RGJsgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcR0FTMg", "Id": "20579ca0-5e3b-11e5-89b2-005056b23c22", "Name": "Gas2", "Description": "", "Path": "\\\\Global AF Acceptance Environment\\Company\\Gas2", "TemplateName": "Gas", "CategoryNames": [], "Links": { "Attributes": "https://DEVSEAT/piwebapi/elements/E0PDGvCF_JoUerHmn03UKDRgoJxXIDte5RGJsgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcR0FTMg/attributes", "Categories": "https://DEVSEAT/piwebapi/elements/E0PDGvCF_JoUerHmn03UKDRgoJxXIDte5RGJsgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcR0FTMg/categories", "EventFrames": "https://DEVSEAT/piwebapi/elements/E0PDGvCF_JoUerHmn03UKDRgoJxXIDte5RGJsgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcR0FTMg/eventframes", "InterpolatedData": "https://DEVSEAT/piwebapi/streamsets/E0PDGvCF_JoUerHmn03UKDRgoJxXIDte5RGJsgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcR0FTMg/interpolated", "RecordedData": "https://DEVSEAT/piwebapi/streamsets/E0PDGvCF_JoUerHmn03UKDRgoJxXIDte5RGJsgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcR0FTMg/recorded", "SummaryData": "https://DEVSEAT/piwebapi/streamsets/E0PDGvCF_JoUerHmn03UKDRgoJxXIDte5RGJsgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcR0FTMg/summary", } }, { "WebId": "E0PDGvCF_JoUerHmn03UKDRg_fTxOXkq5RGHhgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcUk9PVCBET1dOU1RSRUFN", "Id": "39f1f4fd-2a79-11e5-8786-005056b23c22", "Name": "Root Downstream", "Description": "", "Path": "\\\\Global AF Acceptance Environment\\Company\\Root Downstream", "TemplateName": "", "CategoryNames": [], "Links": { "InterpolatedData": "https://DEVSEAT/piwebapi/streamsets/E0PDGvCF_JoUerHmn03UKDRg_fTxOXkq5RGHhgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcUk9PVCBET1dOU1RSRUFN/interpolated", "RecordedData": "https://DEVSEAT/piwebapi/streamsets/E0PDGvCF_JoUerHmn03UKDRg_fTxOXkq5RGHhgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcUk9PVCBET1dOU1RSRUFN/recorded", "SummaryData": "https://DEVSEAT/piwebapi/streamsets/E0PDGvCF_JoUerHmn03UKDRg_fTxOXkq5RGHhgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcUk9PVCBET1dOU1RSRUFN/summary", } }, { "WebId": "E0PDGvCF_JoUerHmn03UKDRgThKq6zpe5RGJsgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcV0FURVIgSU5KRUNUT1Iy", "Id": "ebaa124e-5e3a-11e5-89b2-005056b23c22", "Name": "Water Injector2", "Description": "", "Path": "\\\\Global AF Acceptance Environment\\Company\\Water Injector2", "TemplateName": "Water Injector", "CategoryNames": [], "Links": { "InterpolatedData": "https://DEVSEAT/piwebapi/streamsets/E0PDGvCF_JoUerHmn03UKDRgThKq6zpe5RGJsgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcV0FURVIgSU5KRUNUT1Iy/interpolated", "RecordedData": "https://DEVSEAT/piwebapi/streamsets/E0PDGvCF_JoUerHmn03UKDRgThKq6zpe5RGJsgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcV0FURVIgSU5KRUNUT1Iy/recorded", "SummaryData": "https://DEVSEAT/piwebapi/streamsets/E0PDGvCF_JoUerHmn03UKDRgThKq6zpe5RGJsgBQVrI8IgR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTExcV0FURVIgSU5KRUNUT1Iy/summary", } } ]}
But I don't know how to adapt the Treeview example to show the "Name" as the labels in the treeview and bind to the hierarchical data source. Do I need to use the Datasource.Parse functionality to extract the "Items" to kind of flatten the JSON? Many thanks for any suggestions.
<body> <a class="offline-button" href="../index.html">Back</a> <div id="example"> <div class="demo-section k-header"> <div id="treeview"></div> </div> <script> var serviceRoot = "https://DEVSEAT/piwebapi/assetdatabases/D0PDGvCF_JoUerHmn03UKDRgdnjerQmIrk-WsTnT_VuIGAR0xPQkFMIEFGIEFDQ0VQVEFOQ0UgRU5WSVJPTk1FTlRcU0hFTEw"; homogeneous = new kendo.data.HierarchicalDataSource({ transport: { read: { url: serviceRoot + "/Elements", dataType: "jsonp" } }, schema: { model: { id: "WebID", hasChildren: "Links" } } }); $("#treeview").kendoTreeView({ dataSource: homogeneous, dataTextField: "Name" }); </script> </div> </body>I can't get the navigate event to fire, and it appears to be a bug, since the example in the documentation fails to run as well.
http://docs.telerik.com/kendo-ui/api/javascript/ui/treeview#events-navigate
"Category": { "CategoryID": 1, "CategoryName": "Beverages" }I have an excel button and two custom buttons in a grid toolbar that I have pulled to the right. There are two hyphen-like separators that I want to remove that appear just to the right of the excel button. You can see this in the attached pciture. I tried to remove it with some very novice css but it didn't quite work. Any ideas?
/* hide kendo grid toolbar separators */
.k-button.k-button-icontext.a[class*='k-grid-'] {
visibility:hidden;
}
I am trying to include as low as possible javascript code for chart to work, but I get error: Cannot read property Color of undefined.
What else do I need?
Good afternoon. I am trying to programatically print the grid details using kendo ui. The documentation states that it's as easy
as $("#export").click(function(e) {var grid = $("#grid").data("kendoGrid"); grid.saveAsPDF();});​.
However I found this to not be the case. my code is as follows
var grid = $('#Students').data('kendoGrid');
grid.saveAsPDF();
And I continue to receive the following error: "Cannot Read Property 'Length' of Undefined. What in the world am I doing so wrong. I'm able to see that I have data by hovering over the grid object in debug mode in Chrome. Why on earth would I not be able to use this function?
Please help.
Vincent

Hi,
Can we fill the area between two line charts using angular js?
If yes please specify with example.
Here is the chart attached I want to create.(the red part I want to get)