尝试将信号器数据绑定到KendoUI网格(v2014.1 416)时,我收到错误“超出最大调用堆栈大小”。
这是我目前的代码:
var epConnection = $.hubConnection();
var hub = epConnection.createHubProxy("EventsPendingHub");
var hubStart = epConnection.start();
$('#tblEventsPending').kendoGrid({
sortable: true,
columns: [
{ field: "EventNum" },
{ field: "Area" },
{ field: "Zone" },
{ field: "Priority" },
{ field: "Type" },
{ field: "TIQ" },
{ field: "Location" },
{ field: "Apt"}
],
dataSource: {
type: "signalr",
autoSync: true,
schema: {
model: {
id: "EventNum",
fields: {
"EventNum": { type: "string" },
"Area": { type: "string" },
"Zone": { type: "string" },
"Priority": { type: "string" },
"Type": { type: "string" },
"TIQ": { type: "string" },
"Location": { type: "string" },
"Apt": {type: "string"}
}
}
},
sort: [
{ field: "Priority", dir: "desc"},
{ field: "TIQ", dir: "desc"}
],
transport: {
signalr: {
promise: hubStart,
hub: hub,
server: {
read: "read",
update: "update",
destroy: "destroy",
create: "create"
},
client: {
read: "read",
update: "update",
destroy: "destroy",
create: "create"
}
}
}
}
});
中心代码:
[HubName("EventsPendingHub")]
public class EventsPendingHub : Hub
{
private readonly EventsPending _eventsPending;
public EventsPendingHub() : this(EventsPending.Instance) {}
public EventsPendingHub(EventsPending eventsPending)
{
_eventsPending = eventsPending;
}
public IEnumerable<EventPending> GetAllEventsPending()
{
return _eventsPending.GetAllEventsPending();
}
}
Startup.cs:
[assembly: OwinStartup(typeof(CADView.Startup))]
namespace CADView
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
var hubConfiguration = new HubConfiguration();
hubConfiguration.EnableDetailedErrors = true;
app.MapSignalR(hubConfiguration);
}
}
}
jQuery正在客户端抛出错误......下面的最后一行重复了30多次。
未捕获RangeError:超出最大调用堆栈大小
o.extend.isPlainObject jquery-2.1.0.min.js?hash = 2258a75c-c461-4821-2436-dfdf3af9bffe:2 o.extend.o.fn.extend jquery-2.1.0.min.js?hash = 2258a75c-c461-4821-2436-dfdf3af9bffe:2
答案 0 :(得分:1)
我遇到了类似的问题,我发现kendo ui与更高版本的jQuery不兼容。 例如:-jquery-2.1.0.min.js
它与jquery-1.9.1.min.js兼容 试试这个,你将摆脱这个问题。