0

I have a column in my Kendo grid:

col.Bound(d => d.AmountInclusive).ClientTemplate("<div style=\"text-align:right;\">#=AmountInclusive#</div>").Width(150).EditorTemplateName("DecimalNumber").ClientFooterTemplate("<div style=\"float:left;\">Sum:</div><div style=\"float:right;\">#= kendo.toString(sum, 'n') #</div>");

The editor template, DecimalNumber, looks like this:

<script>
function numericValueChanged(arg) {
    try
    {
        var numericValue = this.value();
        var id = 0;

        if(GridClaimDetailSelectedDataItem != null)
        {
            id = GridClaimDetailSelectedDataItem.ClaimTypeID;
        }

        $.ajax({
            url: '/Claim/GetApprovalRequired',
            type: 'POST',
            data: { Id : id , Value: numericValue },
            dataType: 'json',
            success: function (data) {
                if (GridClaimDetailSelectedDataItem != null) {
                    GridClaimDetailSelectedDataItem.ApprovalRequired = data.ApprovalRequired;
                    $('#GeneralClaimDetailsGrid').data('kendoGrid').refresh();
                }
            }
        });
    }
    catch(ex){
    }
}
</script>   

@model decimal?

@(Html.Kendo().NumericTextBoxFor(m => m)
  .HtmlAttributes(new { style = "width:100%" })
  .Events(e => e
         .Change("numericValueChanged")
    )
)

When I try to edit the value in my grid, and tab out of the cell. I get this error in the developer tools' console:

Uncaught Error: Syntax error, unrecognized expression: .field-validation-valid[data-valmsg-for=], .field-validation-error[data-valmsg-for=]

I have no idea what causes the error. It seems to be part of the jquery I reference. Any ideas on how to solve this?

4

1 回答 1

0

I solved the issue when I added a reference to kendo\jquery.min.js in my _Layout.cshtml

于 2014-09-17T12:02:33.883 回答