+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Jquery Post Request

Jquery Post Request

4 posts, 0 answered
  1. Igor
    Igor avatar
    39 posts
    Registered:
    17 Jul 2012
    16 Apr 2014
    Link to this post

    Hi,

    We are developing a few MVC controls and we have a problem - we are not able to get json data from MVC controller with jquery post request. After reading a few threads on this forum we have implemented a request (creating new route json/controller/action/id), but we have Ajax response and page content on the new page, but not in jquery success message (as stated in the code).

    And there is also an issue with KendoUI grid - sorting by columns does not work. When clicking on sorting button we have a double redirection to one of the methods of MVC controller, as a result we have an empty grid (instead of having the sorted data in the grid)

    Any help would be much appreciated.

    Thanks,

    Igor

  2. Ivan D. Dimitrov
    Ivan D. Dimitrov avatar
    310 posts
    Registered:
    26 Mar 2015
    21 Apr 2014
    Link to this post
    Hi Igor,

    The behavior you describe is indeed strange. Can you please present some code examples so we can try and reproduce the behavior?

    Regards,
    Ivan D. Dimitrov
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  3. Igor
    Igor avatar
    39 posts
    Registered:
    17 Jul 2012
    23 Apr 2014 in reply to Ivan D. Dimitrov
    Link to this post

    Hi Ivan,

    Thanks for getting in touch. Below is the code shared by our developer. Can you please advice what we are doing wrong?

    Thanks,

    Igor

    @model SitefinityWebApp.Mvc.Models.ClientsList
     
    <div>
       
    @(Html.Kendo().Grid((List<SitefinityWebApp.Mvc.Models.ClientProfileModel>)Model.clientScroll)
            .Name("grid")
            .Columns(columns =>
            {
                columns.Bound(c => c.ClientEntity.Name).Width(140);
                columns.Bound(c => c.ClientEntity.HlImprovements).Width(190);
                columns.Bound(c => c.UserProfile.LastModified);
                columns.Bound(c => c.ClientEntity).Template(@<a href="/createnewclient/clientprofile?guid=@item.ClientEntity.UserId">Client Info</a>);
            })
                //.HtmlAttributes(new { style = "height: 380px;" })
                .Scrollable()
                .Sortable()
                .Groupable()        
                .Pageable(pageable => pageable
                    .Refresh(true)
                    .PageSizes(true)
                    .ButtonCount(5))    
                    )
    </div>

     
  4. Ivan D. Dimitrov
    Ivan D. Dimitrov avatar
    310 posts
    Registered:
    26 Mar 2015
    28 Apr 2014
    Link to this post
    Hi Igor,

    Based on your view I cannot find any irregularities in the code. You could try debugging the application yourself and check whether your action is actually called and the json data is returned or the Kendo Grid is not binding correctly. Please, check the routing of the MVC controllers and the route, which is executed from the Grid query. Make sure you do not have duplicate routes or urls, which corresponds with urls of Sitefinity pages or items. I suggest testing the action methods with Fiddler and see what status code and result will the query return. Since, you are using post method, you could try sending an empty json instead of no data, if you have this scenario possible. However, I assume the issue is really coming from the configurations, so the above suggestions could help you investigate whether the problem comes from the controller's action, the routing, the Grid binding or something outside Sitefinity and Kendo configurations.

    Additionally, if the above does not help, I can suggest you open a support ticket where you can send us the controls, or if necessary the entire project so that we can investigate this behavior in further depth.

    Regards,
    Ivan D. Dimitrov
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
4 posts, 0 answered