This is a migrated thread and some comments may be shown as answers.

Edit button returns json but popup edit isn't working?

1 Answer 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 16 May 2013, 05:43 AM
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
@{
    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"))
    )

1 Answer, 1 is accepted

Sort by
0
John
Top achievements
Rank 1
answered on 16 May 2013, 05:22 PM
Nevermind!

Please consider this thread answered/closed.

My application was/is a plugin for an ecommerce (opensource) website.  It builds to a separate target web pro project.  The ecommerce site runs on JQuery 1.7.1 and I was using a KendoWebUI version that targeted JQuery 1.9.1.

I downloaded the KendoWebUI 30-day trial and installed it to the web site in which my plugin runs.  Viola!
Tags
Grid
Asked by
John
Top achievements
Rank 1
Answers by
John
Top achievements
Rank 1
Share this question
or