TypeError: kendo.ui.Pager is not a constructor

3 posts, 0 answers
  1. Daniel
    Daniel avatar
    2 posts
    Member since:
    Jan 2015

    Posted 29 Mar 2016 Link to this post

    Hi,

    I am getting this error when "Pageable: true" with Angularjs and Web Api" 

    Here is the JavaScript Code:

    vm.userAuditHistDataSource = new kendo.data.DataSource({
    transport: {
    read: {
    type: "GET",
    dataType: "json",
    url: 'api/UserAccess/GetUserAuditHistory?id='+ vm.userId + '&dateStart=' + vm.dateStart +'&dateEnd=' + vm.dateEnd
    }
    },
    pageSize: 40
    });

     

    vm.auditGridOptions = {
    dataSource: vm.userAuditHistDataSource,
    columns: [
    { field: "briefDescription", title: "Event", width: 150 },
    { field: "fullDescription", title: "Description" },
    { field: "eventType", title: "Event Type" },
    {
    field: "recordReceivedAt", title: "Recorded At", template: "#= kendo.toString(kendo.parseDate(recordReceivedAt, 'yyyy-MM-dd'), 'MM/dd/yyyy') #"
    }
    ],
    height: 600,
    columnMenu: true,
    scrollable: true,
    sortable: true,
    filterable: true,
    pageable: true,
    };

    Here is the Web Api Code:

    [HttpGet]
    [ActionName("GetUserAuditHistory")]
    public List<UserAuditHistoryEvent> GetUserAuditHistory(Guid id, DateTime dateStart, DateTime dateEnd)
    {
    using (var client = new UserAdministrationClient())
    {
    using (var scope = new OperationContextScope(client.InnerChannel))
    {
    OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = new HttpRequestMessageProperty { Headers = { { "user-agent", string.Format("FACTSInfo;S={0}", SessionId) } } };
    var events = client.ListUserAuditHistory(id, dateStart, dateEnd);
    return events.ToList();
    }
    }
    }

  2. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2289 posts

    Posted 01 Apr 2016 Link to this post

    Hello Daniel,

     

    From provided description and code snippet we are not able to determine what is causing this error. 

     

    There is a Angular example which seems to be working properly. You could either modify above mentioned example or create a new isolated runnable example which demonstrates the problem. Thus we'll be able to debug it locally and assist you further.

     

    Regards,
    Nikolay Rusev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. GLC
    GLC avatar
    1 posts
    Member since:
    Oct 2014

    Posted 04 Apr 2016 Link to this post

    Hello, may I reply to this post because I had the same problem.

    Just created a custom build with Grid + Angular directives. I did not pay attention to the fact that the components of the grid were not selected. In this case, it lacked kendo.pager.js. What seems logical. Just added the grid components needed and all works fine.

    Thanks

     

Back to Top