PDA

View Full Version : [FIXED] validateedit event does not return the newly entered value



devkamdar
13 Jun 2011, 2:49 PM
As per the API doc, validateevent (http://docs.sencha.com/ext-js/4-0/#/api/Ext.grid.plugin.CellEditing-event-validateedit) for cell editing plug-in should return new value in the value attribute and originalValue should contain the value before editing started. Actually, both of these contains the same old value.

devkamdar
17 Jun 2011, 4:25 AM
Any updates on the bug ? I can post the sample if needed.

r1561
18 Jun 2011, 10:20 AM
Also asking about this bug, is it in your todo-list?

I'm bit surprised there is no bug tracking system. I noticed it has been asked many, many times.

mike.estes
19 Jun 2011, 7:36 AM
@devkamdar: I'll file this bug now, but posting example code is always welcomed and useful, it helps the devs efficiently reproduce the issue when going through the process of fixing the bug.

@r1561 we are working on changing our process to track incoming bugs. We have some work to do, we don't want to create a more difficult situation for the community; we want to ensure that our next approach is solid and truly useful/scalable.

mike.estes
19 Jun 2011, 7:39 AM
Thanks for reporting, got it filed as EXTJSIV-2550

AmandaK
8 Jul 2011, 11:33 AM
This bug is still present in 4.0.4. Any word on a fix?

AmandaK
13 Jul 2011, 6:19 AM
Anything...? This bug is causing problems in my application and I don't have a workaround.

Reenjii
4 Aug 2011, 4:12 AM
I use 4.0.2a GPL version of EXTJS and the issue is still there.

It seems that even in premium versions the issue has not been fixed. Is that right ?

Is there a patch for that ?

Thanks

AmandaK
4 Aug 2011, 4:57 AM
It hasn't been fixed in 4.0.4. I'm not sure about 4.0.5, I ran into too many issues after applying 4.0.5 so I rolled back to 4.0.4. If you can possibly use the edit event instead of validateedit, the originalValue and value are set correctly, but I don't know of a workaround other than that.

droessner
9 Aug 2011, 11:03 AM
Just ran into this same issue in 4.0.5. Still not fixed.

killer_duck
27 Oct 2011, 4:53 AM
Still present in 4.0.7
This is my override:

Ext.grid.plugin.CellEditing.override({
onEditComplete : function(ed, value, startValue) {
var me = this,
grid = me.grid,
sm = grid.getSelectionModel(),
activeColumn = me.getActiveColumn(),
dataIndex;

if (activeColumn) {
dataIndex = activeColumn.dataIndex;


me.setActiveEditor(null);
me.setActiveColumn(null);
me.setActiveRecord(null);
delete sm.wasEditing;

//déplacé ici:
me.context.value = value;

if (!me.validateEdit()) {
return;
}
// Only update the record if the new value is different than the
// startValue, when the view refreshes its el will gain focus
if (value !== startValue) {
me.context.record.set(dataIndex, value);
// Restore focus back to the view's element.
} else {
grid.getView().getEl(activeColumn).focus();
}

// supprimé :
//me.context.value = value;
me.fireEvent('edit', me, me.context);
}
}
});

jmaia
2 Nov 2011, 9:27 AM
Still present in 4.0.7
This is my override:
...


Hello killer_duck,

I tried your override and it didn't work. I still get the value equal to the originalValue on the validateedit event, and not the new value I have entered on the grid cell. Where exactly do I need to add your code ? I pasted it into my main application file (a.k.a. app.js) and it did not work. Maybe I should put it somewhere else ?

This is an issue that is causing me all sorts of problems on the app I'm currently developing, so any help would be great.

Regards,

Joao Maia

Sharkanana
6 Jan 2012, 5:58 AM
Still present in 4.1 beta 1.

The above override still fixes it.

Meytal_adk2
28 Mar 2012, 7:26 AM
Hey,

We are using 4.0.7 and still facing the same issue.
Is there a solution for this issue?

Thanks.

Sébastien.Volle
13 May 2012, 11:52 PM
Issue still present 4.1 GA /:)

n4cer500
21 May 2012, 10:28 AM
Found a nasty hack fix to this problem. Surprised it's been lingering for so long though; after all, what other use for validateedit is there?



validateedit: function(editor) {
var enteredValue = this.editors.items[0].field.rawValue;
}

nbabinski
20 Jun 2012, 8:08 AM
Its not correct to use an editor getting it just with hard-coded number. In major cases there are more than one editor.

Found a nasty hack fix to this problem. Surprised it's been lingering for so long though; after all, what other use for validateedit is there?



validateedit: function(editor) {
var enteredValue = this.editors.items[0].field.rawValue;
}


The above override is working.
Also if you do not want to override you can use a small workaround in the validateedit event listener:


validateedit: function(ed, ctx) {
var editor = ed.getEditor(ctx.record, ctx.column),
v = editor.getValue();


//v contains the current value, you can work with it and validate it
}

jdebono
20 Jul 2012, 12:59 AM
Any idea when this will be fixed?

mberrie
10 Aug 2012, 9:36 PM
This was reported a year ago!

A 'validateedit' event without receiving the actual value... do I need to say more?

Amazing!

jdebono
11 Aug 2012, 4:51 AM
Yeah and I hate work arounds :s

Daniil
31 Aug 2012, 2:42 AM
I was surprised how long it is not fixed according the fact that it doesn't look like a hard-to-fix bug.

I am sure anyone from ExtJS team can fix it in a minute :)

nabil13579
20 Sep 2012, 5:07 PM
Huh ! i'm really surprised by this long living bug ! is there some joke here ? the number 2550 means something special to someone at Sencha ? or when it needs just one cut and paste to fix a bug, it is not considered a bug ?

:-?

mike.estes
20 Sep 2012, 5:56 PM
this has been fixed & merged into source about a week ago. I forced an update so this report is reflecting the fix now, not sure why it didn't pick it up earlier.

Daniil
20 Sep 2012, 10:10 PM
Hi Mike,

It is great! Thank you for the update!

guoal
24 Oct 2012, 6:01 PM
The bug still exists in 4.1...I am new here and so surprised that it has survived such a long time.

Daniil
24 Oct 2012, 8:48 PM
Hi,

As marked above, it is fixed in 4.1.3 Sprint 1.

DSACyrus
3 May 2013, 3:42 AM
So is this available in 4.1.3? I am currently using 4.1.3 and value still contains the original value.