Opened 14 years ago

Closed 14 years ago

#5250 closed defect (wontfix) does not work well with editors

Reported by: guest Owned by: Bryan Forbes
Priority: high Milestone: 1.2
Component: DojoX Grid Version: 1.0
Keywords: grid exception copy objects dojox Cc: [email protected]…, [email protected]
Blocked By: Blocking:

Description (last modified by Bryan Forbes)

I tried to get the grid to work with editors, and it threw an acception. I found out this was because it was using split(0) to copy the row. Since objects don't have a split method it raised an acception. Upon adding the function below to, the editor works normally, but the value in the grid does not change after editing. No exception was given.

copyRow: function(inRowIndex) {

var newRow = {};

var row = this.getRow(inRowIndex);

for (i in row) {

newRow[i] = row[i];

} return newRow;


Attachments (1) (1.4 KB) - added by guest 14 years ago.
finally the working patch if somebodu is interested…

Download all attachments as: .zip

Change History (8)

comment:1 Changed 14 years ago by dylan

Milestone: 1.2

comment:2 Changed 14 years ago by guest

I needed this too, so I found a quick fix (pointed by you in the right direction).
If it's correct may by it can make to 1.1?
Actually I copied some missing code from
and added a setDatum method to update the data after editing.
This is the code that I use (it must be added to:

// ****************************************************************************
//* Maciej Pestka modification, (code copied form
copyRow: function(inRowIndex){
	var row = {};
	var backstop = {};
	var src = this.getRow(inRowIndex);
	for(var x in src){
		if(src[x] != backstop[x]){
			row[x] = src[x];
	return row;
//* Maciej Pestka modification, (code copied form
_attrCompare: function(cache, data){
	dojo.forEach(this.fields.values, function(a){
		if(cache[] != data[]){ return false; }
	}, this);
	return true;
//* Maciej Pestka modification, (code copied form
endModifyRow: function(inRowIndex){
	var cache = this.cache[inRowIndex];
		var data = this.getRow(inRowIndex);
		if(!this._attrCompare(cache, data)){
			this.update(cache, data, inRowIndex);
		delete this.cache[inRowIndex];
//* Maciej Pestka modification, (bugfix that updates appropriate field)
setDatum: function(inDatum, inRowIndex, inColIndex){[inRowIndex][this.fields.get(inColIndex).key] = inDatum;
	this.datumChange(inDatum, inRowIndex, inColIndex);
// ****************************************************************************

I think the above code fixes this bug.

Maciej Pestka
maciej DOT pestka AT wp DOT pl

comment:3 in reply to:  description Changed 14 years ago by guest

Just found an additional bug in attributes comparison _attrCompare
Actually 2 bugs:

  1. the shoule be replaced with a.key (as key is used in
  2. The false was never returned using _attrCompare code copied from (does it mean that there is also bug in

The code should be replaced with:

//* Maciej Pestka modification, (bugfix that compares attributes correctly)
_attrCompare: function(cache, data){
	var values = this.fields.values;
	for (var i in values){
		var v = values[i];
		if(cache[v.key] != data[v.key]){ 
			return false; 
	return true;

Maciej Pestka


How to setup email notification about the ticked updates?

Changed 14 years ago by guest

Attachment: added

finally the working patch if somebodu is interested...

comment:4 Changed 14 years ago by Bryan Forbes

Cc: [email protected] added
Description: modified (diff)

Is this ticket still valid with the current trunk code?

comment:5 Changed 14 years ago by Bryan Forbes

Owner: changed from sorvell to Bryan Forbes

comment:6 Changed 14 years ago by Maciej Pestka

It's valid in 1.1.1 release. In the current trunk I could not find this file (seems like the folder structure is different and the declaration of is not available any more?)

comment:7 Changed 14 years ago by Bryan Forbes

Resolution: wontfix
Status: newclosed is no longer supported (since we're not doing a bug fix release for 1.1.1). Because it is deprecated, we have written a porting guide: . This should help with the transition to the new code base.

Note: See TracTickets for help on using tickets.