1) RestService.revert for DataGrid not working
Solution:
restViewItemFileService.revert = function() {
for(var s in this._pendings) {
var p = this._pendings[s]
<b> if(p.op == 1) {</b>
for( var i in p.modAttrs) {
p.modAttrs[i] = p.oldAttrs[i]
}
}
}
this.created = 0;
return true;
}
restViewItemFileService.setValue = function( /* item */ item,
/* string */ attribute,
/* almost anything */ value){
this._assertIsItem(item);
this._assertHasAttribute(item, attribute);
if (typeof value == 'undefined' || value === null)
throw new Error("TableStore.setValue: invalid parameter");
// Don't allow changing the item's identity
if(attribute == this._identity){
throw new Error("TableStore does not support changing the value of an item's identifier.");
}
var id = this.getIdentity(item)
var pending = this._pendings[id]
if(!pending) {
pending = {op:1, origAttrs: item.attributes, modAttrs:{}, <b>oldAttrs:{}</b>}
this._pendings[id] = pending
} else {
if(pending.op==2) {// Deleted, do nothing
return false;
}
// Created or modified, just continue
}
var oldValue = item.attributes[attribute];
item.attributes[attribute] = pending.modAttrs[attribute] = value;
<b>if ( !pending.oldAttrs[attribute] )</b>
pending.oldAttrs[attribute] = oldValue;
this.onSet(item, attribute, oldValue, value);
return true;// boolean
}
2) Encoding for restViewItemService not working
Solution:
function fixEncoding() {
if( !(dojo._xhrPost )) {
dojo._xhrPost = dojo.xhrPost;
}
dojo.xhrPost = function (args) {
if ( args.headers && ( args.headers["Content-Type"] == "application/json" ) ) {
args.headers["Content-Type"] = "application/json;charset=UTF-8";
}
return dojo._xhrPost(args);
}
}
3) Quotes not working in DataGrid
Sulution:
function fixQuotes() {
dojox.grid.cells.Cell.prototype.formatEditing = function(inDatum, inRowIndex)
{
this.needFormatNode(inDatum, inRowIndex);
return '';
};
}
4) After Infinity scrolling(DataGrid…) edit mode not working(cannot exiting from edit mode)
Solution:
set rowsPerPage = 10000+