2

我有一个连接到 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();});
4

1 回答 1

4

重复我的评论作为答案,这样你就可以接受它(我们每个人都会获得更多的代表;))

如果你onSelected反之,会发生什么?

于 2010-10-20T21:46:04.680 回答