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

TypeError: kendo.ui.Pager is not a constructor

2 Answers 618 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 29 Mar 2016, 02:50 PM

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 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 01 Apr 2016, 06:23 AM

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!
 
0
GLC
Top achievements
Rank 1
answered on 04 Apr 2016, 09:01 AM

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

 

Tags
Grid
Asked by
Daniel
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
GLC
Top achievements
Rank 1
Share this question
or