我们以前曾经拥有telerik网格,我试图升级到kendo网格,我能够显示kendo网格,但下拉列表出现问题。
我通过使用延期true解决了剑道同步错误。
HTML代码
@(Html.Kendo().DropDownList().Name("businessUnitId")
.DataTextField("Text")
.DataValueField("Value")
.HtmlAttributes(new { @class = "k-dropdown-custom"})
.BindTo(Model.AvailableBusinessUnits)
.Deferred(true))
jquery code
$('#ddlbusinessUnitId').on("change", function () {
@*var buzUnit = $('#@Html.FieldIdFor(model => model.BusinessUnitId )').val();
var buzUnitName = $("#BuzUnitId option:selected").text();*@
var bUnit = $('#ddlbusinessUnitId').val();
@*if (buzUnit == null || buzUnit == '') {
$("#spanErrorMessage").text("Please select Business Unit.");
}*@
$.ajax({
type: "Get",
url: "/RiskAnalytics/GetVaRDaysDisplay",
data: { businessUnit: bUnit },
success: function () {
//$("commodityVaRGrid").html("");
//$("commodityVaRGrid").html(data);
},
error: function (err) {
alert('err');
控制器代码
public ActionResult GetVaRDaysDisplay(int businessUnit)``
{
return PartialView("_PartialVarDays", new VaRDaysModel());