Hi,
We're having some problems with Kendo MVC Validation when data attributes on inputs have no value.
For example (when using FluentValidation integrated with MVC) our inputs are generated as follows:
<input class="form-control text-box single-line k-invalid valid" data-val="true" data-val-number="The field Range1 must be a number." data-val-range="'Range1' must be greater than or equal to ''." data-val-range-max="" data-val-range-min="" data-val-required="'Range1' should not be empty." id="Range1" name="Range1" type="number" value="" aria-required="true" aria-describedby="Range1-error" aria-invalid="true">
The problematic code being: data-val-range="'Range1' must be greater than or equal to ''." data-val-range-max="" data-val-range-min=""
When using the input the error appears no matter what value you enter: Range1' must be greater than or equal to ''.
The reason these attributes are generated without values is because they are dynamic/not constant. The FluentValidation rule is that the Range field must be greater than another field on the screen.
I know that I could write custom validation for this rule but actually I am happy for the input to ignore the validation of the range in this case.
The same application works fine when using jQuery validate (jQuery validate ignores the empty range attributes and the form can be submitted).
How do I stop Kendo Validator attempting to validate this attribute? Shouldn't it ignore the attributes as they are empty (not valid), and treat the input as valid?
(image attached shows the problem)
Regards,
Chris
I have a diagram with multiple shapes. Each shape has multiple rectangles.
1. Is there a way (do you have examples) to identify which rectangle in the shape was clicked in the Click event?
2. Is there any mechanism to store data in the rectangles? i.e. Similar to data-id="5" in standard html. I'm pretty sure I can figure out the Id of each rectangle from the shape.dataItem - but it would be alot easier if I could store data with each rectangle.
Thanks!

First, please take a look at this simple example
<div id="view"> <span data-bind="text: obj"></span> <input data-bind="value: obj.name" /> </div> <script> $(document).ready(()=> { let model = kendo.observable({ obj: { name: "John", value: 15, toString:function(){return JSON.stringify(this);} }}); kendo.bind($("#view"), model); }); </script>
When html is loaded everything is fine but when field 'name' is changing, refresh is not triggered for the span. How do I trigger it ?
Hi!, i'm trying to use a template into the same template. This is the code:
<script id="nestedTemplate" type="text/x-kendo-template">
<li><b>#: _folderName #</b>
<ul data-template="nestedTemplate" data-bind="source: _folders"></ul>
<ul data-template="filesTemplate" data-bind="source: _files"></ul>
</li>
</script>
json (remote)
{
"_folderName": "Dpto CGE",
"_folders": [
{
"_folderName": "Informes Test",
"_folders": [
],
"_files": [
{
"OriginalPath": "Comparativa de Planificación Mensual con Producción Hasta Marzo 2013.sql"
},
{
"OriginalPath": "Comparativa de Planificación Mensual con Producción.sql"
},
{
"FullPath": "\\\\192.168.10.6\\pfolder$\\jgperez\\Control De Gestión\\Informes Gema\\Obras.xls"
}
]
}
So, the template is calling itself each _folders is found but it doesn't works: : e.bind is not a function
Can i use nested templates with MVVM?
Thanks.

tabStrip.append( [ { id: "myId1", text:title, contentUrl:url } ] );
...
tabStrip.select("#myId1");

I am using Kendo MVVM. This ApisTemplate is called Remotely and It opens up. Problem is in "PaxPreferenceTemplate" template. There 2 source binding. Only 1st works i.e know Even if you use <label data-bind:"text: Segment.SegmentDetailsToDisplayPricing" ></label> still result would be same.
Please tell what would be correct way
Note: ALL below code is in 1 file.
<script id="ApisTemplate" type="text/x-kendo-template" class="KendoExtTemplate"> <div> <div data-bind="source: ApisVMList.PaxPreferenceBySegment" data-template="PaxPreferenceTemplate"></div> <div style="text-align:center;"> <button type="button" id="btnIssueTicket" onclick="SaveIssueTicket(this)" class="k-button k-primary Apis_submit " style="width: 100px; height: 25px; margin-right: 5px;"> <i class="fa fa-floppy-o fa-inverse" aria-hidden="true"></i> Save </button> <button type="button" class="k-button " onclick="CloseApisWindow(this)" style="width: 100px; height: 25px;"><i class="fa fa-ban"></i> Cancel</button> </div> </div></script><script id="PaxPreferenceTemplate" type="text/x-kendo-template" class="KendoExtTemplate"> <div data-bind="source: Segment" data-template="SegmentTemplate"></div> <div data-bind="source: PaxInfo" data-template="PaxInfoTemplate"></div></script><script id="SegmentTemplate" type="text/x-kendo-template" class="KendoExtTemplate"> <label data-bind="text: SegmentDetailsToDisplayPricing"></label></script><script id="PaxInfoTemplate" type="text/x-kendo-template" class="KendoExtTemplate"> <div> <label data-bind="text: Pax.PersonName"></label> <input data-role="dropdownlist" data-text-field="PassportNumber" data-value-field="PassportNumberID" data-bind="source: PossiblePassports" /> <input data-role="dropdownlist" data-text-field="FrequentFlyernumber" data-value-field="FrequentFlyernumberID" data-bind="source: PossibleFrequentFlyers" /> </div></script>

Is there a way to customize the UI of kendo upload to show the failed uploads in a different list and succeeded ones on another? Like the following..
You are currently uploading 3 files
Failed : 2
Succeeded : 2
Uploading...
doc1
doc2
doc3
Failed
doc4
doc5
Completed
doc6
doc7
i'm writing a website using kendo grid, and now i'm stuck in displaying the Selective Data when i chose an item on the drop down list, i don't use the Filter action but instead i'm using a Ajax which will call my Jsonresult in the controller. How to make the grid show those items ?
Here is the method in my Controller :
public JsonResult LoadSelection(Categories Option)
{
try
{
List<Product> ls = new List<Product> { };
foreach (var item in db.Product.ToList())
{
if (item.Cate_ID== Option.Cate_ID)
ls.Add(item);
}
return new JsonResult()
{
Data = ls,
MaxJsonLength = Int32.MaxValue,
JsonRequestBehavior = JsonRequestBehavior.AllowGet
};
}
catch (Exception e)
{
return Json(e.Message);
}
and here is my dropdownlist handler :
var dropdown = grid.find("#Item").kendoDropDownList({
dataTextField: "Cate_ID",
dataValueField: "Cate_ID",
autoBind: false,
optionLabel: "All",
dataSource: Shared_Data,
change: function () {
var value = this.value();
if (value) {
Selected_Data = value;
$.ajax({
data: {"ID_LoaiKH":Selected_Data },
url: "/Product/LoadSelection",
type: "GET",
dataType: "json",
success: function()
{
$("#grid_1").data('kendoGrid').dataSource.read();
}
});
Hi,
I have a problem to get the inner items of hierarchical grid.
This is the main grid:
@(Html.Kendo().Grid(Model.List1)
.Name("List1")
.Columns(columns =>
{
columns.Bound(p => p.ColA).Title("ColA").Width(135);
columns.Bound(p => p.ColB).Title("ColB").Width(110).Template(@<text>
<a href='\\#' class='link' style="color:red;" onclick='UpdateItem(@item.ColC) '>@item.ColC</a>
</text>);
})
.Pageable()
.Sortable()
.Groupable()
.DataSource(dataSource => dataSource.Server().PageSize(5))
.HtmlAttributes(new { style = "height:500px;" })
.DetailTemplate(
@<text>
@(Html.Kendo().Grid(item.InnerList)
.Name("Inner_" + item.ListID)
.Columns(columns =>
{
columns.Bound(o => o.ColD1).Title("ColD1").Width(110).HtmlAttributes(new { @class = "btn-link", @style = "cursor: pointer;" }).HtmlAttributes(new { @onclick = "UpdateItem('"+@item.ColD1+")" })
columns.Bound(o => o.ColD2).Title("ColD2").Width(110);
})
.DataSource(dataSource => dataSource.Server())
.Pageable()
.Sortable()
)
</text>
)
______________________________________________
1. In the detail template I tried add a link to column ColD1 as in column ColC with .Template but it didn't work.
So I used HtmlAttributes instead to simulate a link :
I added: @class = "btn-link", @style = "cursor: pointer;" and it worked.
Why can't I use the .Template in the inner grid?
2. When I click on the link I want to run a javascript function. I tried sending the inner item as parameter to the function (as I did successfully in the main grid with @item) but it didn't work.
I tried to send it in many ways:
1. @item.ColD1
2. o.ColD1
3.\\#= ColD1\\#
But none of the ways worked....
I'll be glad to receive your help,
Elad.