views:

11

answers:

1

Hi all,

i have a datagrid (created programmatically) wich is connected to an JsonRestStore. In that Grid there are some columns rendered as checkboxes (type:dojox.grid.cells.Bool) Everything works fine, displaying Data and so on. To be able to edit inline, i connected the onApplyEdit to store.save. The Problem is, that the change of the checkbox is only sent if i select another row. But i want to trigger a put-Request as soon, as i click on the checkbox.

is that possible?

my Grid-Data:

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();});
A: 

Repeating my comment as an answer so you can accept it (and we each earn more rep ;) )

what happens if you snag onSlected instead?

drachenstern
that done the trick! thanks a lot! (I connected onSelect to the Grid)
Tobias
You're welcome. Sad part is I've never done anything with dojox either ;) ... means they have a really good setup.
drachenstern