【发布时间】:2012-09-27 08:21:23
【问题描述】:
我有一个连接到某个商店的 DataGrid。我希望它在更改后立即保存。
只有一个可编辑的列具有 3 选项下拉设置为始终编辑,定义如下:
<table data-dojo-type="dojox.grid.EnhancedGrid" id="leaveGrid" data-dojo-id="leaveGrid"
selectable=false singleClickEdit="true">
<thead>
<tr>
<th field="TITLE" width="25%">Title</th>
<th field="REQUESTEDON" width="15%">Requested</th>
<th field="CODE" width="15%">Code</th>
<th field="LEAVEDATE" width="15%">Leave Date</th>
<th field="HRS" width="15%">Hours</th>
<th field="STATUS" width="15%" editable="true" alwaysEditing="true" cellType="dojox.grid.cells.Select" options='<?php echo $this->statusOptions;?>'>Status</th>
</tr>
</thead>
</table>
下拉列表的选项由 php 填充,但这应该不是问题。
我做了以下连接:
dojo.connect(gridStore, 'onSet', saveStore);
哪个处理存储的保存。
现在的问题是我点击下拉菜单,更改选项,然后......什么也没有发生。除非我按回车键或单击屏幕上的其他位置(如果愿意,可以更改焦点或选择),否则不会触发任何事件;只有这样事件才会触发。
我应该使用其他事件吗?我可以做些什么来让这些数据在用户更改后立即保存而无需进一步交互?
【问题讨论】:
标签: javascript ajax dojo