Validation Issue with Listview
HTML
<script src="https://raw.github.com/appendto/jquery-mockjax/master/jquery.mockjax.js"></script>
<script src="http://cdn.kendostatic.com/2012.1.322/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.1.322/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.1.322/styles/kendo.default.min.css">
<form id="container">
<div >
<ul data-role="listview" data-template="ul-template" data-bind="source: theList" >
</ul>
</div>
<input type="submit"/>
</form>
<script id="ul-template" type="text/x-kendo-template">
<li>
id: <span data-bind="text: ID"></span>
name: <input data-bind="value: Name" />
</li>
</script>
JavaScript
//Expecting to see the same behavior as if the input field had required on it in that
// clearing out one of the input fields and clicking submit shows the is required
// validation message
kendo.ui.ListView.fn.options.navigatable = false;
var a = kendo.observable({
theList: new kendo.data.DataSource({
transport: {
read: "/test/zaza",
dataType: "json"
},
schema: {
model: {
id: "ID",
fields: {
Name: {
editable: true,
nullable: true,
validation : {
required:true,
customRule: function(input){alert('bad data');}
}
}
}
}
}
})
});
$("#container").kendoValidator().data("kendoValidator");
$.mockjax({
url: "/test/zaza",
responseText: [{ "ID": 0, "Name": "" }, { "ID": 1, "Name": "St-Louis" }, { "ID": 2, "Name": "Dorval" }, { "ID": 3, "Name": "St-Pierre" }]
});
kendo.bind($("#container"), a);