0

いくつかの列を持つフォームがあります.1つはチェックボックスで、チェックボックス自体をクリックすると2つのフォーム送信が送信され、データベースのロックアウトが発生します。

index.jsp:

var gridLayout = [
  ...
  {name:"Recurring", field:"isRecurring", type: dojox.grid.cells.Bool, width: "50px",editable:true}
  ...
]

var grid = new dojox.grid.DataGrid({
  id: 'grid',
  store: myStore ,
  structure: gridLayout
});

dojo.connect(grid, 'onApplyCellEdit', function (a,index,c) { submit(index) } );

「onApplyCellEdit」に代わるものはありますか?

4

2 に答える 2

1

user1189762 が言ったことは本当ですが、別の方法があると思います。

レイアウトでフォーマッターを使用できます

      var layout = [[
                        { 'name': 'Column 1', 'field': 'id', hidden: true },
                        { 'name': 'Name', 'field': 'name', 'width': '200px' },
//This is the formatter for the Checkboix attribute so it can be in the middle in the start or wherever you need it
                        { 'name': 'Delete Mapping', 'field': '_item', 'width': '175px', formatter: checkBoxFormatter },
                        { 'name': 'Note', 'field': 'note', hidden: true },
                        { 'name': 'mappings', 'field': 'mappingelements', hidden: true }
                    ]];






 function checkBoxFormatter(value, rowIndex)
    {
    var checkBox = new CheckBox({            
                checked: false,
                onChange: function(b){ 
//The value is whatever you want the two parameter value and rowindex will get the row value or the row index
                  submit(value)
                             }
            });
    } 

これはうまくいくはずです。

于 2013-10-09T16:00:20.050 に答える
1

今日、私は同じ問題を抱えています。

道場の公式回答:

DojoX Grid および EnhancedGrid は、dgrid および gridx を支持して廃止されました。これら 2 つのグリッドのいずれかを使用するには、コードをアップグレードする必要があります。ただし、古い DojoX Grid コードへのパッチを検討します。

回避策については、これを参照してください。まだ試していません。

于 2013-10-09T09:26:50.433 に答える