dojo和dGrid的新手,所以我希望我能忽略一些明显的东西。这与此Saving a Dgrid JsonRest-based Store几乎相同,但没有接受答案。
最近在dGrid中添加了一个编辑框(非常简单),现在我希望能够保存这些更改。我该怎么保存?我尝试过的并不起作用。
define([
'require',
'dgrid/List',
'dgrid/OnDemandGrid',
'dgrid/Selection',
'dgrid/Keyboard',
'dgrid/editor',
'dgrid/extensions/ColumnHider',
'dojo/_base/declare',
'dojo/_base/array',
'dojo/Stateful',
'dojo/when',
'dstore/RequestMemory',
'put-selector/put',
'dojo/_base/lang',
'dojo/domReady!'
], function (require, List, OnDemandGrid, Selection,
Keyboard, editor, Hider, declare, arrayUtil, Stateful,
when, RequestMemory, put, lang) {
storeJunctions = new RequestMemory({ target: require.toUrl('./dataJunctions.json') });
junctionGrid = new (declare([OnDemandGrid, Selection, editor, Keyboard, Hider]))({
collection: storeJunctions,
selectionMode: 'single',
columns: {
J1: { label: 'J1', editor: 'text' },
J2: { label: 'J2', editor: 'text' },
...
}
}, 'grid');
在HTML中我有一个保存按钮:
<button type='button' onclick="junctionGrid.save();return false;">Save Junctions</button>
它不可能那么简单,所以没有消息,数据不会发布/更新到我的本地开发服务器上的文件。