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

jQuery PartialGrid.ascx with .Groupable() broken

4 Answers 56 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.
Sebastian S
Top achievements
Rank 1
Sebastian S asked on 03 Jun 2010, 04:48 AM
Implementing the example code for using partial views loaded with jQuery works fine, however adding '.Groupable()' breaks the partial view (GET issued instead of POST). I'm not a jQuery expert and we are currently evaluating the telerik controls for use in our project. The Site.Master page registers all telerik .js scripts.

Please help.

-- Sebastian
PartialGrid.ascx
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<MBM.WebAdmin.Models.PrimaryUser>>" %>
<%= Html.Telerik().Grid(Model)
            .DataBinding(dataBinding => dataBinding.Ajax().Select("_AjaxBinding", "User"))
            .Name("Grid")
            .Columns(columns =>
                {
                    columns.Bound(o => o.Name);
                    columns.Bound(o => o.CardID);
                    columns.Bound(o => o.GenTime);
                })
            .Pageable()
            .Sortable()
            .Filterable()
            .Groupable()
    %>


Part of Site.master
<% Html.Telerik().ScriptRegistrar()
       .jQuery(false)
        .DefaultGroup(group => group
            .Add("telerik.common.min.js")
            .Add("telerik.grid.grouping.min.js")
            .Add("telerik.grid.filtering.min.js")
            .Add("telerik.grid.min.js")
            .Add("telerik.grid.editing.min.js")
            .Add("telerik.draganddrop.min.js")
            .Add("telerik.datepicker.min.js")

            .Add("telerik.menu.min.js")
            .Add("telerik.panelbar.min.js")
            .Add("telerik.tabstrip.min.js")
            .Add("telerik.textbox.min.js")
            .Add("telerik.treeview.min.js")
            
            .Add("~/Scripts/jquery.validate.js")
            ).Render();
%>   

4 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 03 Jun 2010, 06:57 AM
Hi Sebastian S,

Your grid must be ajax bound in order to be operational in this case. Since it is loaded with jquery (again through ajax) any HTTP requests made (either get or post) will make the partial view unloaded.

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
Sebastian S
Top achievements
Rank 1
answered on 03 Jun 2010, 10:26 PM
Hi Atanas,

As far as I can tell, the grid is already ajax bound  - the controller has the following code:

 [GridAction]
        public ActionResult _AjaxBinding()
        {
            var primaryUsers = PrimaryRepository.Test();
            return View(new GridModel( primaryUsers));
        }

What I dont understand is why if .Groupable() is removed the grid does a POST, where as if it is present a GET request is issued instead. I.e. the same code works fine (AJAX retrieval and all) with .Groupable() not used

Cheers,
--Sebastian
0
Atanas Korchev
Telerik team
answered on 04 Jun 2010, 08:17 AM
Hi Sebastians

I cannot reproduce this locally. I suggest you send us a sample project. You could  use some public web site to host it e.g. dropbox.com.

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
Sebastian S
Top achievements
Rank 1
answered on 08 Jun 2010, 01:13 AM
Hi Atanas,

We've managed to resolve the issue. We traced the issue down our view folder name not being in sync with our controller name.

Thanks for your help anyhow.

--Sebastian
Tags
Grid
Asked by
Sebastian S
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Sebastian S
Top achievements
Rank 1
Share this question
or