dojox - 带复选框的数据网格 -> onSet/触发保存JsonRestStore
我有一个连接到 JsonRestStore 的数据网格(以编程方式创建)。 在该网格中,有一些列呈现为复选框(类型:dojox.grid.cells.Bool) 一切工作正常,显示数据等等。为了能够内联编辑,我将 onApplyEdit 连接到 store.save。问题是,只有当我选择另一行时才会发送复选框的更改。但我想在单击复选框时立即触发 put-Request。
这可能吗?
我的网格数据:
store = new dojox.data.JsonRestStore({"idAttribute":"id","target":"\/settings\/edit"});
var listGridLayout = [
{"field":"id","width":"100px;","styles":"text-align:left;","name":"Id"},
{"field":"type","width":"150px;","styles":"text-align:left;","name":"Type"},
{"field":"sql_fill","width":"250px;","styles":"text-align:left;","name":"SqlFill"},
{"field":"standard","width":"150px;","styles":"text-align:left;","name":"Standard"},
{"field":"validate","width":"150px;","styles":"text-align:left;","name":"Validate"},
{"field":"field","width":"150px;","styles":"text-align:left;","name":"Field"},
{"field":"tbl","width":"150px;","styles":"text-align:left;","name":"Tbl"},
{"field":"label","width":"150px;","styles":"text-align:left;","name":"Label"},
{"field":"reihenf","width":"50px;","styles":"text-align:center;","name":"Reihenf"},
{"field":"pflicht","width":"150px;","styles":"text-align:left;","name":"Pflicht"},
{"field":"descr","width":"250px;","styles":"text-align:left;","name":"Descr"},
{"field":"gruppe","width":"150px;","styles":"text-align:left;","name":"Gruppe"}];
listGridGrid = new dojox.grid.DataGrid({"selectionMode":"single","rowSelector":"20px","store":store,"rowsPerPage":30,"singleClickEdit":1,"style":"width:98%; height: 97%","id":"listGrid","structure":listGridLayout}), document.createElement('div');
dojo.byId("listGrid").appendChild(listGridGrid.domNode);
listGridGrid.startup();
dojo.connect(listGridGrid, "onApplyEdit", function(row){ store.save();});
i have a datagrid (created programmatically) wich is connected to an JsonRestStore.
In that Grid there are some columns rendered as checkboxes (type:dojox.grid.cells.Bool)
Everything works fine, displaying Data and so on. To be able to edit inline, i connected the onApplyEdit to store.save. The Problem is, that the change of the checkbox is only sent if i select another row. But i want to trigger a put-Request as soon, as i click on the checkbox.
is that possible?
my Grid-Data:
store = new dojox.data.JsonRestStore({"idAttribute":"id","target":"\/settings\/edit"});
var listGridLayout = [
{"field":"id","width":"100px;","styles":"text-align:left;","name":"Id"},
{"field":"type","width":"150px;","styles":"text-align:left;","name":"Type"},
{"field":"sql_fill","width":"250px;","styles":"text-align:left;","name":"SqlFill"},
{"field":"standard","width":"150px;","styles":"text-align:left;","name":"Standard"},
{"field":"validate","width":"150px;","styles":"text-align:left;","name":"Validate"},
{"field":"field","width":"150px;","styles":"text-align:left;","name":"Field"},
{"field":"tbl","width":"150px;","styles":"text-align:left;","name":"Tbl"},
{"field":"label","width":"150px;","styles":"text-align:left;","name":"Label"},
{"field":"reihenf","width":"50px;","styles":"text-align:center;","name":"Reihenf"},
{"field":"pflicht","width":"150px;","styles":"text-align:left;","name":"Pflicht"},
{"field":"descr","width":"250px;","styles":"text-align:left;","name":"Descr"},
{"field":"gruppe","width":"150px;","styles":"text-align:left;","name":"Gruppe"}];
listGridGrid = new dojox.grid.DataGrid({"selectionMode":"single","rowSelector":"20px","store":store,"rowsPerPage":30,"singleClickEdit":1,"style":"width:98%; height: 97%","id":"listGrid","structure":listGridLayout}), document.createElement('div');
dojo.byId("listGrid").appendChild(listGridGrid.domNode);
listGridGrid.startup();
dojo.connect(listGridGrid, "onApplyEdit", function(row){ store.save();});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
重复我的评论作为答案,以便您可以接受它(并且我们每个人都会获得更多代表;))
Repeating my comment as an answer so you can accept it (and we each earn more rep ;) )