lastScrollTop: 0,
border: false,
+
+ // Change the hideMode to offsets so that we get accurate measurements when
+ // the roweditor is hidden for laying out things like a TriggerField.
+ hideMode: 'offsets',
initComponent: function() {
var me = this,
}
},
- onFieldAdd: function(hm, fieldId, column) {
+ onFieldAdd: function(map, fieldId, column) {
var me = this,
colIdx = me.editingPlugin.grid.headerCt.getHeaderIndex(column),
field = column.getEditor({ xtype: 'displayfield' });
me.insert(colIdx, field);
},
- onFieldRemove: function(hm, fieldId, column) {
+ onFieldRemove: function(map, fieldId, column) {
var me = this,
field = column.getEditor(),
- fieldDom = field.el.dom;
+ fieldEl = field.el;
me.remove(field, false);
- fieldDom.parentNode.removeChild(fieldDom);
+ if (fieldEl) {
+ fieldEl.remove();
+ }
},
- onFieldReplace: function(hm, fieldId, column, oldColumn) {
+ onFieldReplace: function(map, fieldId, column, oldColumn) {
var me = this;
- me.onFieldRemove(hm, fieldId, oldColumn);
+ me.onFieldRemove(map, fieldId, oldColumn);
},
clearFields: function() {
var me = this,
- hm = me.columns;
- hm.each(function(fieldId) {
- hm.removeAtKey(fieldId);
+ map = me.columns;
+ map.each(function(fieldId) {
+ map.removeAtKey(fieldId);
});
},
}
// Get a default display field if necessary
- field = column.getEditor(null, { xtype: 'displayfield' });
+ field = column.getEditor(null, {
+ xtype: 'displayfield',
+ // Default display fields will not return values. This is done because
+ // the display field will pick up column renderers from the grid.
+ getModelData: function() {
+ return null;
+ }
+ });
field.margins = '0 0 0 2';
- field.setWidth(column.getWidth() - 2);
+ field.setWidth(column.getDesiredWidth() - 2);
me.mon(field, 'change', me.onFieldChange, me);
// Maintain mapping of fields-to-columns
// This will fire events that maintain our container items
me.columns.add(field.id, column);
+
+ if (me.isVisible() && me.context) {
+ me.renderColumnData(field, me.context.record);
+ }
},
loadRecord: function(record) {
view = grid.view,
store = view.store,
column = me.columns.get(field.id),
- value = field.getRawValue();
+ value = record.get(column.dataIndex);
// honor our column's renderer (TemplateHeader sets renderer for us!)
if (column.renderer) {