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

[Solved] Editable MVC Grid Popup mode not working

6 Answers 149 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
smdk
Top achievements
Rank 1
smdk asked on 23 Nov 2010, 02:05 PM
I am using version 2010.3.1110.235

This is how my grid looks.

The page renders fine with "Add new record", Edit and Delete buttons.
But when I click on them the page refreshes and nothing happens.

what am i missing.

Thanks

<% Html.Telerik().Grid<DaoAdmin.Models.OrderEditModel>()
        .Name("Orders")
        .DataKeys(Keys =>
        {
            Keys.Add(c => c.OrderId);
        })
        .ToolBar(commands => commands.Insert().ButtonType(GridButtonType.ImageAndText).ImageHtmlAttributes(new { style = "margin-left:0" }))
        .DataBinding(dataBinding =>
            {
                dataBinding.Ajax()
                    .Select("GetOrders", "Order")
                    .Insert("InsertOrder", "Order")
                    .Update("SaveOrder", "Order")
                    .Delete("DeleteOrder", "Order");
            })
        .Columns(columns =>
        {
            columns.Bound(ord => ord.OrderId).Width(100);
            columns.Bound(ord => ord.FirstName).Width(200);
            columns.Bound(ord => ord.LastName).Width(200);
            columns.Command(commands =>
            {
                commands.Edit().ButtonType(GridButtonType.ImageAndText);
                commands.Delete().ButtonType(GridButtonType.ImageAndText);
            }).Width(180).Title("Commands");
        })
        .Editable(editing => editing.Mode(GridEditMode.PopUp))
        .Pageable(paging => paging.PageSize(20))
        .Scrollable(scrolling => scrolling.Height(580))
        .Sortable()
        .Render();                       
%>

6 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 23 Nov 2010, 03:05 PM
Hello smdk,

 It could be because of  this problem. Make sure the right version of jquery.validate.js is included in your project. 
 This could also occur if any the required javascript files are not included, a ScriptRegistrar is missing or there is a JavaScript error in the page. 

If you need further assistance please provide a sample project so we can troubleshoot it.

Regards,

Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
smdk
Top achievements
Rank 1
answered on 23 Nov 2010, 03:37 PM
Thanks Atanas, That did not solve my problem.

Do you have any sample project that has mvc ajax grid edit feature working?

I am using VS2010, 4.0 and MVC 2.0, c#

Thanks
0
Atanas Korchev
Telerik team
answered on 23 Nov 2010, 03:39 PM
Hi smdk,

Telerik Extensions for ASP.NET MVC come with a full set of examples which you can see online here. The examples are located in the Examples folder of the installation (or the location where you extracted the zip file).

Greetings,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
smdk
Top achievements
Rank 1
answered on 23 Nov 2010, 03:42 PM
Right i have that and that is what i used to build my project and that's not helping me.
Also that was in vs2008 and had to convert it.

That is why i was asking for stand alone project so I can compare.

Thanks
0
Atanas Korchev
Telerik team
answered on 23 Nov 2010, 03:45 PM
Hi smdk,

 The sample project is supposed to work and I just tested it locally again. Could you please attach your project so I can check it out? 

Kind regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
smdk
Top achievements
Rank 1
answered on 23 Nov 2010, 04:06 PM
OK,
I got it to work.

Sample project has this scriptregistrar.

<% Html.Telerik().ScriptRegistrar()
                 .DefaultGroup(group => group
                     .Add("telerik.examples.js")
                     .Compress(true))
                 .OnDocumentReady(() => { %>prettyPrint();<% })
                 .Render(); %>

I changed that to this and it worked.
Needed the jQuery(true) in there.

<%= Html.Telerik().ScriptRegistrar().jQuery(true).DefaultGroup(group => group.Combined(true)) %>
not sure how the test project works without that but my project doesn't. Thanks
Tags
Grid
Asked by
smdk
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
smdk
Top achievements
Rank 1
Share this question
or