Hi,
I've got a DojoGrid with a Dojo checkbox in the heading, but when I select the checkbox it loses the state (ticked/unticked).
<table id="gridDeltas" jsId="gridDeltas" dojoType="dojox.grid.DataGrid" store="deltaInfo" style="height: 276px; width: 100%;" >
<thead>
<tr>
<th field="other" ><input type="checkbox" dojoType="dijit.form.CheckBox" name="showOther" onClick="requestJSONFeed();"></th>
</tr>
</thead>
</table>
The method requestJSONFeed() is to request new data for the table to render, which it does. But the tick box will only flash ticked for a fraction of a second before returning to its unticked state.
Debugging the requestJSONFeed() method shows that it has the correct value
function requestJSONFeed(){
var showOther = dojo.byId("showOther").checked;
// showOther has the CORRECT value.
var xhrArgs = {
url: "../secure/jsonServlet?showOther="+showOther,
handleAs: "json",
preventCache: true,
load: function(data) {
// tick box still selected at this point.
// when I return from this method call, the box becomes unticked!!?
}
}
//Call the asynchronous xhrGet
var deferred = dojo.xhrGet(xhrArgs);
}
I presume that someone is consuming the event, but I'm stumped as to what does?!?
Moving the tickbox out of the table header, e.g. before the table is defined, works fine. So it's something to do with the event model in the datagrid.
Can anyone help out?
Note: setting the datagrid canSort=false doesn't help.
Jeff Porter