NNKL.COM welcome to my space |
HOME Amending grid cell data value at BeforeEdit event. |
| Amending grid cell data value at BeforeEdit event. | | Published by: mike 2010-03-16 |
| | Ext JS Forums - Search Results:: Increasing cell text size in EditorGrid. SeaSharp 路 11-14-2007 03:13 PM Amending grid cell data value at BeforeEdit event. SeaSharp 路 11-14-2007 03:23 AM http://extjs.com/forum/search.php?do=finduser&u=13064&starteronly=1HOME | I am trying to concatenate two text fields in a grid抯 BeforeEdit event handler. The idea is to merge two text fields and make them available as a single editable string in a cell. Ext 2.x: Help [Archive] - Page 12 - Ext JS Forums:: save modified data in Editable Grid Example. XmlReader Help: get value from the specific field easily. Amending grid cell data value at BeforeEdit event. http://extjs.com/forum/archive/index.php/f-9-p-12.htmlHOME | Users Guide:: DataObjects, or in unbound mode, where the grid itself manages the data. The grid now fires events before and after the user adds or removes rows, http://download.componentone.com/pub/Documentation/C1FlexGridManual2005.pdfHOME |
The handler is called and my code joins the two strings fields but the text shown in the editable cell is the original value.
Is the code below the correct way to amend a grid cell value as the cell enters edit mode?
onGridBeforeEdit: function( event ){
if (( event.field === "Description" )
&& ( event.record.get( "Note" )))
{
var x = ' ' + event.record.get( "Note" ); Ext 2.x: Help - Page 1541 - Ext JS Forums:: Page 1541-Community help forum for Ext JS version 2.0 Amending grid cell data value at BeforeEdit event. SeaSharp 路 11-14-2007 03:23 AM http://extjs.com/forum/forumdisplay.php?f=9&order=desc&page=1541HOME | Ext 2.x: Help - Page 1604 - Ext JS Forums:: Page 1604-Community help forum for Ext JS version 2.0 Amending grid cell data value at BeforeEdit event. SeaSharp 路 11-14-2007 03:23 AM http://www.extjs.com/forum/forumdisplay.php?f=9&order=desc&page=1604HOME |
event.value = event.value + x;
}
},
The event arg is just the Event object - setting some arbitrary property called value does nothing.
The docs for the event indicate that "value" is a formal property of the event. In the same application I have successfully amended the "value" property during the grid validateedit event so I was hoping for equivalent behavior in the beforeedit event.
Anyhow no problem, if as you say your reading of the Ext code confirms my observations.
After posting I thought my alternative would be to declare a new record field to represent the combined text and then bind the grid column to this. In the validate handler I can maintain the two separate shadow fields.
That's not going to accomplish anything. The event arg is just the Event object - setting some arbitrary property called value does nothing. Look at the code for EditorGrid.startEditing to understand what's happening. I don't think there's an easy way to accomplish what you want without overriding the startEditing fn to play with the data.
Actually value is a valid property in this case, but it's just passed to the handler for evaluation - it's not used in the code that executes after the beforeedit event returns.
Get Smart About Monitoring Virtual Machines
Microsoft Gets Ex-Streamly Cozy with U.K.'s MediaWave
|
You are looking at:nnkl.com's Amending grid cell data value at BeforeEdit event., click nnkl.com to home
|
|