-
28 Jul 2010 3:35 PM #1
[SOLVED] Getting the Form Field using Row Edit
[SOLVED] Getting the Form Field using Row Edit
Hello, I'm trying to change the value of some fields according to the value of one in row edit mode.
I've attached the change event to the field in question, but I can't figure out how to change the value of the other fields, right now I have:
That changes the value on the grid, after I cancel the edit, but not on the editor field, I've searched the documentation and can't find how to get the form Field.Code:edField.on('change', function(){ var ed = this.editor; var rec = this.Store.getAt(ed.rowIndex); rec.beginEdit(); rec.set('col', 'New Value'); rec.set('col2', 'New Value'); rec.endEdit(); rec.commit(); }.createDelegate(this));
Thanks for your help.Last edited by Huevoos; 29 Jul 2010 at 7:30 AM. Reason: SOLVED
-
29 Jul 2010 6:26 AM #2
-
29 Jul 2010 7:29 AM #3
Finally, after many, many, many unsuccessful attempts I found my answer.
RowEdit has a property items which holds all the fields in the row, from there it was just a matter of iterating through them:
Maybe this will help someone in a similar situationCode:edField.on('change', function(){ var items = this.editor.items; items.each(function(it){ switch(it.column.dataIndex){ case 'col': it.setValue('New Value 1'); break; case 'col2': it.setValue('New Value 2'); break; }; });
Similar Threads
-
Can we edit form field labels in GXT like we can with ExtJS?
By Jeff31UK in forum Ext GWT: DiscussionReplies: 2Last Post: 1 Mar 2010, 7:47 AM -
EditorGrid, edit a field, then click on a CheckColumn -> resets the edited field
By pouniok in forum Ext 2.x: Help & DiscussionReplies: 4Last Post: 18 May 2009, 6:37 AM -
How to add a row to editorgrid field in form
By GokhanNL in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 7 Aug 2008, 11:59 PM -
how can we transfer datas from selected grid row to edit form by using ajax?
By akbeyfb in forum Ext 1.x: Help & DiscussionReplies: 0Last Post: 28 Jul 2007, 6:27 AM


Reply With Quote