1

特定のストアに接続された DataGrid があります。変更したらすぐに保存したい。

次のように定義された常に編集するように設定された 3 つのオプションのドロップダウンを持つ編集可能な列は 1 つだけです。

                <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);

ストアの保存を処理します。

問題は、ドロップダウンをクリックしてオプションを変更しても...何も起こらないことです。Enterキーを押すか、画面の他の場所をクリックしない限り、イベントは発生しません(必要に応じてフォーカスまたは選択を変更します)。そうして初めて、イベントが発生します。

私が使用すべき別のイベントはありますか?ユーザーがデータを変更するとすぐに、それ以上の操作なしでこのデータを保存するにはどうすればよいですか?

4

1 に答える 1

0

There are a couple of things you can do here:

1) Use onClick instead of onSet

2) Use onApplyCellEdit event which requires Enter key or blur. You can display a tooltip to user on how to use inline editing

3) Inspect the html generated by grid and attach handler to the select drop down's id/class/name

于 2012-09-28T08:18:01.623 に答える