ExtJs. Set rowediting cell value -
i have grid rowediting plugin. editor have 2 columns: 1 combobox , disabled textfield.
i need alter textfield value after changing combobox value.
i have combobox listener:
listeners = { select: function (combo, records) { var editorrecord = mygrid.getplugin('roweditplugin').editor.getrecord(); editorrecord.data["somecol"] = "somevalue"; } }
but value in textfield not refresh until calling of roweditor.
i need set text value cell, without updating store. , if click cancel button of roweditor, need cell value returning old one.
thanks time, replies , help.
you can alter using selection model of grid,something :
{ text: 'type', dataindex: 'type', editor: { xtype: 'combo', typeahead: true, selectontab: true, displayfield:"name", listeners: { select: function(combo, records) { mygrid= this.up('grid'); var selectedmodel = this.up('grid').getselectionmodel().getselection()[0]; //selectedmodel.set('dataindexofnextcol', "success"); val = combo.getvalue(); if(val == 'type1'){ ext.getcmp('textfld').setvalue("success"); } else{ ext.getcmp('textfld').setvalue("failure"); } } }, { text: 'item', dataindex: 'item', editor: { xtype: 'textfield', id: 'textfld' } }
you have commit changes on update.so can phone call edit
event listener,
listeners: { edit: function(editor, e) { e.record.commit(); } },
for reference , have @ demo
extjs
No comments:
Post a Comment