Hi again all. How can this be converted to a ClientTemplate inside a Kendo Grid?
columns.Bound(document => document.Revisions).Template(@<text>
@if (item.Revisions.Count <= 1)
{
<div>
</div>
}
else
{
@Html.Raw(string.Format("<text><a id='img' class='icon' href=\"{1}\"><img src=\"{0}\" alt='' style='border:none;' /></a></text>", Url.Content("~/Images/docrev1.png"), Url.Action("ViewRev", "ViewRevisions", new { id = item.OriginalQRCodeID })));
}
</text>).Title("").Width(25);
My problem right now is that "Revisions" is an IEnumerable<T> type bound from the server. How do I get its count from client side? Is this even possible? Thanks very much for all the help and I look forward to the response(s).
Romel
validnamevalidation: function (input) { if (input.is('input[data-bind="value:Name"]')) { input.attr("data-validnamevalidation-msg", "A team already exists with that name."); var passed = false; var currentDataItem = $("#teamsGrid").data("kendoGrid").dataItem($(input.context)); var currentId = currentDataItem.Id; if (currentId == "") currentId = -1; $.ajax({ async: false, url: currentViewModel.crudServiceBaseUrl + "CheckTeamNameBeforeAdd?teamId=" + currentId + "&name=" + input.val().trim(), success: function (result) { if (result == "False") passed = false; else passed = true; }, error: function (jqXHR, textStatus, errorThrown) { alert(errorThrown + '. ' + jqXHR.responseText); }, complete: function (jqXHR, textStatus) { } }); return passed; } return true;},$('*').each(function(){ $(this).click();});