Hi all. I'm new to the JS/JQuery/AJAX world & new to Kendo controls as well.
Not sure what's going on and would appreciate any help. My grid displays with an edit and delete button. Both buttons hit the controller actions as expected and the delete does, in fact delete. However it, it returns to a blank page instead of a refreshed grid, and my edit button returns raw JSON to an empty view. I'm guessing I don't have the grid wired correctly so that it know's how to catch the pass. Here's the code in my partial view. I commented out some columns that I don't need to see until the edit screen.
Any ideas? TIA
Not sure what's going on and would appreciate any help. My grid displays with an edit and delete button. Both buttons hit the controller actions as expected and the delete does, in fact delete. However it, it returns to a blank page instead of a refreshed grid, and my edit button returns raw JSON to an empty view. I'm guessing I don't have the grid wired correctly so that it know's how to catch the pass. Here's the code in my partial view. I commented out some columns that I don't need to see until the edit screen.
Any ideas? TIA
@{
Layout = null;
}
@model IEnumerable<
Nop.Plugin.Other.Rewards.Models.ReferralProgramModel
>
@(Html.Kendo().Grid((IEnumerable<
Nop.Plugin.Other.Rewards.Models.ReferralProgramModel
>)Model)
.Name("kendoGrid")
.Columns(columns =>
{
//columns.Bound(p => p.Id).Width(0).Hidden();
columns.Bound(p => p.Name).Width(100).Title("Name");
//columns.Bound(p => p.ReferralDiscount).Width(20).Title("Friend Discount");
//columns.Bound(p => p.DiscountEventsPerReferral).Width(100).Title("Discounts per Referral");
columns.Bound(p => p.PointsAwardPerReferral).Width(100).Title("Points Reward on referral");
columns.Bound(p => p.MinimumPurchaseForAward).Width(100).Title("Min Purchase Amt");
//columns.Bound(p => p.RewardEventsPerReferredFriend).Width(100).Title("Discount Events");
//columns.Bound(p => p.CookieLifespan).Width(100).Title("Cookie Lifespan");
columns.Bound(p => p.InsertDateUtc).Format("{0:d}").Width(100).Title("Insert Date");
columns.Command(command => command.Edit());
columns.Command(command => command.Destroy());
})
.Editable(editable => editable.Mode(GridEditMode.PopUp)) //.TemplateName("ReferralEditForm")
.Pageable(pager => pager.PageSizes(new[] { 5, 10, 20, 50 }))
.Sortable()
.Selectable()
.Filterable()
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => {
model.Id(p => p.Id);
model.Field(p=>p.Id).Editable(false);
})
.Read(read => read.Action("GetReferralPrograms", "Referrals"))
.Update(update => update.Action("UpdateRefferalProgram", "Referrals"))
.Destroy(destroy => destroy.Action("DeleteReferralProgram", "Referrals"))
.Create(create => create.Action("CreateReferralProgram", "Referrals"))
)