我正在使用jaydata來管理僅客戶端數據存儲。數據通過SignalR Broadcast接收。接收到的數據被緩存在內存中。一秒鐘內存緩衝區刷新到jaydata存儲並保存。Jaydata as KendoDataSource不會自動刷新新記錄添加
綁定到jaydata存儲的Kendo網格不會自動更新。一旦jaydata saveChanges方法完成,我需要調用dataSource的read方法。下面的代碼是定時器觸發時調用的方法。
在我的劍道網格,我已經定義了數據源如下:
dataSource: scribeDb.Messages.asKendoDataSource({
pageSize: 20,
sort: [{ field: "SequenceId", dir: "desc" }]
})
我已經定義了實體,實體集,並刻劃爲:
$data.Entity.extend("ScribeMessage", {
SequenceId: { type: "string", required: true, key: true, computed: false },
ScribeId: { type: "string", required: true },
Environment: { type: "string", required: true },
LogLevel: { type: "integer", required: true },
Program: { type: "string", required: true },
Subject: { type: "string", required: false },
Message: { type: "string", required: false },
MachineName: { type: "string", required: true },
InstanceId: { type: "string", required: false },
ComponentId: { type: "string", required: false },
Exception: { type: "string", reguired: false },
ServerTime: { type: "date", required: true },
ClientTime: { type: "date", required: true },
User: { type: "string", required: true }
});
$data.EntityContext.extend("ScribeDatabase", {
Messages: { type: $data.EntitySet, elementType: ScribeMessage }
});
var scribeDb = new ScribeDatabase({ provider: "indexedDb", databaseName: "ScribeMessages" });
我期待網格綁定的數據源自動檢測到底層數據存儲已經改變。
是否有必要強制數據源讀取?
非常感謝您的幫助。