0

我在 dojo 对话框中创建了一个 dojox.grid.EnhancedGrid。它工作正常,当我第一次单击按钮时,所有显示都正常。但是当我单击“取消”隐藏对话框,然后再次单击按钮以触发该功能并显示对话框时。显示完全错误,网格表头不完整,无数据显示。所有网格都是灰色的。

请帮我在对话框中重新显示道场网格。

<table dojoType="dojox.grid.EnhancedGrid" id="grid6" plugins="{indirectSelection: true, selectable: true, dnd: true, nestedSorting: true, loadingMessage: 'Loading...', errorMessage: 'An error exists within the data.' }" selectionMode="extended" class="popupDojoTable" style="height:200px;"  rowSelector="0px">
                            <colgroup span="3" noscroll="true"></colgroup>
                            <colgroup span="6"></colgroup>
                            <thead>
                                <tr>
                                    <th field="machType" width="60px">Machine<br />type</th>
                                    <th field="machSerNum" width="100px">Machine<br />serial<br />number</th>
                                    <th field="mesNum" width="80px" styles="text-align:right;">MES<br />number</th>
                                    <th field="bookType" width="60px">Book<br />type</th>
                                    <th field="machMod" width="80px">Machine<br />model</th>
                                    <th field="transType" width="80px">Transaction<br />type</th>
                                    <th field="effDte" width="80px">Effective<br />date</th>
                                    <th field="custNum" width="80px">Customer<br />number</th>
                                    <th field="assetPeriodNum" width="60px" styles="text-align:right;">Asset<br />period<br />number</th>
                                </tr>
                            </thead>
                            <tbody>
                             ...
                            </tbody>
                        </table>

然后我通过脚本插入数据。它通过 ajax 从服务器获取数据,然后显示包含网格的对话框“dialogRecordsOnHold”。

dojo.xhrPost({
                              url: this.url,
                              handleAs: "json",
                              headers : {
                                  "Content-Type" : "application/json; charset=utf-8",
                                  "Accept" : "application/json"
                              },
                              postData : dojo.toJson({finEnterpNum:this.finEnterpNum, adjNum:this.adjNum}),
                            ....
                     load: function(data) {
                         var gridData = new dojo.data.ItemFileWriteStore({data:{items:data}});
                         dijit.byId('grid6').setStore(gridData);

                         // hide dialogProcessing
                         dijit.byId('dialogOpeningView').hide();
                         dijit.byId('dialogRecordsOnHold').show();
                     },
)};

取消按钮的功能非常简单:

<button dojoType="dijit.form.Button" type="button" onclick="dijit.byId('grid6').setStore(null);dijit.byId('dialogRecordsOnHold').hide();">Cancel</button>
4

1 回答 1

0

I have fix it by myself. Change the code into:

 load: function(data) { 
 // hide dialogProcessing 
dijit.byId('dialogOpeningView').hide();
 dijit.byId('dialogRecordsOnHold').show();
var gridData = new dojo.data.ItemFileWriteStore({data:{items:data}});
 dijit.byId('grid6').setStore(gridData);
 },
 )};
于 2012-09-22T02:39:46.110 回答