Paging issue after upgrade to v2013.2.716

10 posts, 0 answers
  1. Joshua
    Joshua avatar
    5 posts
    Member since:
    Jul 2012

    Posted 08 Aug 2013 Link to this post

    I seem to have hit an issue with paging after upgrading to the latest version of kendo.

    It happens with ajax and server binding.  It appears that the filter data for the data source passes undefined values, which results in a 500 error on the server when it tries to bind to the filter values.  If I apply a filter, paging starts to work again.

    (server binding example)

    Grid Code
     @(Html.Kendo()
                    .Grid(Model.Items)
                    .Name("operatorList")
                    .DataSource(ds => ds.Server())
                    .Columns(columns =>
                        {
                            columns.Bound(c => c.Name);
                        })
                        .Filterable()
                        .Pageable())

    Action
     public ActionResult Index()
            {
                var vm = new LookUpIndexViewModel<T>();
                vm.Recent = GetRecentlyActive();
                vm.Items = All();
                return View(vm);
            }

    Url Requested (when paging)
    http://localhost/browse/operator?operatorList-sort=&operatorList-page=2&operatorList-pageSize=15&operatorList-group=&operatorList-filter=undefined~undefined~undefined

    Scripts Included (in this order)
    <script src="/scripts/kendo.all.js"></script>
    <script src="/scripts/kendo.aspnetmvc.js"></script>
    doulbe checked versions also both say: v2013.2.716

    Stack Trace
    [NullReferenceException: Object reference not set to an instance of an object.]
    Kendo.Mvc.Infrastructure.Implementation.FilterNodeVisitor.Visit(PropertyNode propertyNode) +60
    Kendo.Mvc.UI.DataSourceRequestModelBinder.BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) +465
    Kendo.Mvc.UI.Grid`1.ProcessDataSource() +395
    Kendo.Mvc.UI.Grid`1.WriteHtml(HtmlTextWriter writer) +1145
    Kendo.Mvc.UI.WidgetBase.ToHtmlString() +105
    Kendo.Mvc.UI.Fluent.WidgetBuilderBase`2.ToHtmlString() +19
    System.Web.WebPages.WebPageExecutingBase.WriteTo(TextWriter writer, Object content) +57
    CtrlDev.Wdb.Web.Areas.Browse.Views.Operator.Index.Execute() in f:\Projects\CtrlDev.WDB\CtrlDev.Wdb.Web\Areas\Browse\areas\browse\views\operator\Index.cshtml:26
    System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +279
    System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +124
    System.Web.WebPages.StartPage.ExecutePageHierarchy() +142
    System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +103
    RazorGenerator.Mvc.PrecompiledMvcView.Render(ViewContext viewContext, TextWriter writer) +951
    System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +377
    System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +32
    System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613
    System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613
    System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613
    System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +613
    System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +263
    System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +236
    System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +28
    System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
    System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +42
    System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
    System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +42
    System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +1725
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +560

    Found this question on SO, not sure if it is related, but it sounds like it.

    Any help would be greatly appreciated!

    Thanks!
    Josh
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 09 Aug 2013 Link to this post

    Hi Joshua,

     This is a known regression which is fixed in the latest internal build.

    Regards,
    Atanas Korchev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Joshua
    Joshua avatar
    5 posts
    Member since:
    Jul 2012

    Posted 09 Aug 2013 Link to this post

    Hi Atanas, 
    Thanks for the update, I upgraded our project to the internal build, and all ajax bound/paged grids are working as expected now.  However, the server bound/paged ones still have the same issue, that said the url they request now only includes one undefined filter field now:

    ?operatorList-sort=&operatorList-page=2&operatorList-pageSize=15&operatorList-group=&operatorList-filter=undefined

    Regards,
    Josh
  5. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 12 Aug 2013 Link to this post

    Hi Josh,

    Could it be due to browser caching? Also make sure that all files have been updated - the JavaScript and dll. Having this problem means that the upgrade wasn't complete for some reason.

    Regards,
    Atanas Korchev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Joshua
    Joshua avatar
    5 posts
    Member since:
    Jul 2012

    Posted 12 Aug 2013 Link to this post

    Hey Atanas, 
    Thanks for getting back to me!  After ruling out all browser caching issues, I started suspecting something in our JS was causing the issues. Turns out we had some code that extended the Array prototype, and Kendo seems to not like that, at all!

    We have 5 or so functions that were added, and having any one of them on the page caused the paging issue. We can work around that easily by removing the prototype extensions, which I want to do anyway.  Odd thing is we use ES5 Shim, and it seems to work fine.

    Anyway, you can reproduce my issue by creating a new Kendo UI MVC Project in VS, creating a server bound grid, and adding this to the top of the page:

        @*Won't work with this included*@
    <script>
        Array.prototype.max = function () {
            return Math.max.apply({}, this);
        };
    </script>

    I have a sample project together if you want me to send it over, just let me know!
    Thanks,
    Josh

  7. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 13 Aug 2013 Link to this post

    Hi Joshua,

     It seems that extending the Array prototype breaks the $.isEmptyObject function (http://jsbin.com/ubeqit/1/edit). This in turn breaks some filtering code in the data source hence the problem. 

    Regards,
    Atanas Korchev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  8. Joshua
    Joshua avatar
    5 posts
    Member since:
    Jul 2012

    Posted 13 Aug 2013 Link to this post

    That is an interesting discovery, I will keep it in mind!  I removed the prototype extensions and everything is working as expected now.  
    Thanks for your help :)
    -Josh
  9. Joar
    Joar avatar
    2 posts
    Member since:
    Jan 2013

    Posted 19 Sep 2013 Link to this post

    We're experiencing a very similar issue after we clear a column filter during the Ajax call to the MVC controller action and needs a supported build as the internal builds are not recommended for production.

    I've verified that the internal build fix this issue, and I want to avoid downgrading to the previous version because we also want to use Typescript 0.9. Do you have any time frame for when you'll ship a fix for this issue?

    Thanks,
    Joar Øyen
  10. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 19 Sep 2013 Link to this post

    Hello Joar,

     All internal builds are fully supported and we recommend them for production. They contain only bug fixes for issues discovered in the latest official release. Other than that we have recently released a service pack release.

    Regards,
    Atanas Korchev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  11. Joar
    Joar avatar
    2 posts
    Member since:
    Jan 2013

    Posted 19 Sep 2013 Link to this post

    Hi Atanas,

    Thanks for the feedback, and I'm going to update to the latest release. I didn't have any updates in Telerik Control Panel yesterday and pretty sure I didn't see anything this morning either but now I'm able to update to version 2013.2.918.

    The page for your internal builds do however state that "intended for development only" and "not recommended for production purposes" and that's why I was hesitant to use the 2013.2.912 version from this page:
    http://www.telerik.com/account/your-products/internal-builds.aspx?type=2&skucid=45

    - Joar
Back to Top
UI for ASP.NET MVC is VS 2017 Ready