PDA

View Full Version : [FIXED] [4.2] IE9: Grid column lines not synced with header in locked+grouped sample



mankz
5 Apr 2013, 2:30 AM
Notice the 1px offset in the locked grid.


Ext.require([
'Ext.grid.*',
'Ext.data.*',
'Ext.form.field.Number',
'Ext.form.field.Date',
'Ext.tip.QuickTipManager'
]);

Ext.define('Task', {
extend: 'Ext.data.Model',
idProperty: 'taskId',
fields: [
{name: 'projectId', type: 'int'},
{name: 'project', type: 'string'},
{name: 'taskId', type: 'int'},
{name: 'description', type: 'string'},
{name: 'estimate', type: 'float'},
{name: 'rate', type: 'float'},
{name: 'due', type: 'date', dateFormat:'m/d/Y'}
]
});

var data = [
{projectId: 100, project: 'Ext Forms: Field Anchoring', taskId: 112, description: 'Integrate 2.0 Forms with 2.0 Layouts', estimate: 6, rate: 150, due:'06/24/2007'},
{projectId: 100, project: 'Ext Forms: Field Anchoring', taskId: 113, description: 'Implement AnchorLayout', estimate: 4, rate: 150, due:'06/25/2007'},
{projectId: 100, project: 'Ext Forms: Field Anchoring', taskId: 114, description: 'Add support for multiple types of anchors', estimate: 4, rate: 150, due:'06/27/2007'},
{projectId: 100, project: 'Ext Forms: Field Anchoring', taskId: 115, description: 'Testing and debugging', estimate: 8, rate: 0, due:'06/29/2007'},
{projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 101, description: 'Add required rendering "hooks" to GridView', estimate: 6, rate: 100, due:'07/01/2007'},
{projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 102, description: 'Extend GridView and override rendering functions', estimate: 6, rate: 100, due:'07/03/2007'},
{projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 103, description: 'Extend Store with grouping functionality', estimate: 4, rate: 100, due:'07/04/2007'},
{projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 121, description: 'Default CSS Styling', estimate: 2, rate: 100, due:'07/05/2007'},
{projectId: 101, project: 'Ext Grid: Single-level Grouping', taskId: 104, description: 'Testing and debugging', estimate: 6, rate: 100, due:'07/06/2007'},
{projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 105, description: 'Ext Grid plugin integration', estimate: 4, rate: 125, due:'07/01/2007'},
{projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 106, description: 'Summary creation during rendering phase', estimate: 4, rate: 125, due:'07/02/2007'},
{projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 107, description: 'Dynamic summary updates in editor grids', estimate: 6, rate: 125, due:'07/05/2007'},
{projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 108, description: 'Remote summary integration', estimate: 4, rate: 125, due:'07/05/2007'},
{projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 109, description: 'Summary renderers and calculators', estimate: 4, rate: 125, due:'07/06/2007'},
{projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 110, description: 'Integrate summaries with GroupingView', estimate: 10, rate: 125, due:'07/11/2007'},
{projectId: 102, project: 'Ext Grid: Summary Rows', taskId: 111, description: 'Testing and debugging', estimate: 8, rate: 125, due:'07/15/2007'}
];

Ext.onReady(function(){

Ext.tip.QuickTipManager.init();

var store = Ext.create('Ext.data.Store', {
model: 'Task',
data: data,
sorters: {property: 'due', direction: 'ASC'},
groupField: 'project'
});

var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
var showSummary = true;
var grid = Ext.create('Ext.grid.Panel', {
width: 800,
height: 450,
frame: true,
title: 'Sponsored Projects',
iconCls: 'icon-grid',
renderTo: document.body,
columnLines : true,
store: store,
plugins: [cellEditing],
selModel: {
selType: 'cellmodel'
},
dockedItems: [{
dock: 'top',
xtype: 'toolbar',
items: [{
tooltip: 'Toggle the visibility of the summary row',
text: 'Toggle Summary',
enableToggle: true,
pressed: true,
handler: function(){
showSummary = !showSummary;
var view = grid.lockedGrid.getView();
view.getFeature('group').toggleSummaryRow(showSummary);
view.refresh();
view = grid.normalGrid.getView();
view.getFeature('group').toggleSummaryRow(showSummary);
view.refresh();
}
}]
}],
features: [{
id: 'group',
ftype: 'groupingsummary',
groupHeaderTpl: '{name}',
hideGroupedHeader: true,
enableGroupingMenu: false
}],
columns: [{
text: 'Task',
width: 300,
locked: true,
tdCls: 'task',
sortable: true,
dataIndex: 'description',
hideable: false,
summaryType: 'count',
summaryRenderer: function(value, summaryData, dataIndex) {
return ((value === 0 || value > 1) ? '(' + value + ' Tasks)' : '(1 Task)');
}
}, {
text: 'Task',
width: 300,
locked: true,
tdCls: 'task',
sortable: true,
dataIndex: 'description',
hideable: false
},{
header: 'Project',
width: 180,
sortable: true,
dataIndex: 'project'
}, {
header: 'Due Date',
width: 130,
sortable: true,
dataIndex: 'due',
summaryType: 'max',
renderer: Ext.util.Format.dateRenderer('m/d/Y'),
summaryRenderer: Ext.util.Format.dateRenderer('m/d/Y'),
field: {
xtype: 'datefield'
}
}, {
header: 'Estimate',
width: 130,
sortable: true,
dataIndex: 'estimate',
summaryType: 'sum',
renderer: function(value, metaData, record, rowIdx, colIdx, store, view){
return value + ' hours';
},
summaryRenderer: function(value, summaryData, dataIndex) {
return value + ' hours';
},
field: {
xtype: 'numberfield'
}
}, {
header: 'Rate',
width: 130,
sortable: true,
renderer: Ext.util.Format.usMoney,
summaryRenderer: Ext.util.Format.usMoney,
dataIndex: 'rate',
summaryType: 'average',
field: {
xtype: 'numberfield'
}
}, {
header: 'Cost',
width: 130,
sortable: false,
groupable: false,
renderer: function(value, metaData, record, rowIdx, colIdx, store, view) {
return Ext.util.Format.usMoney(record.get('estimate') * record.get('rate'));
},
summaryType: function(records){
var i = 0,
length = records.length,
total = 0,
record;

for (; i < length; ++i) {
record = records[i];
total += record.get('estimate') * record.get('rate');
}
return total;
},
summaryRenderer: Ext.util.Format.usMoney
}]
});
});


*EDIT BY SLEMMON
Issue reproducable in IE7
- attached screenshot

slemmon
5 Apr 2013, 6:43 AM
My instinct is to just believe you honestly. But, I tried your example in Chrome, Safari, and Firefox and the offset isn't catching my eye. Any chance you can screenshot you're seeing? Or maybe it's not affecting all browsers perhaps?

mankz
5 Apr 2013, 7:05 AM
Argh, I'm an i****t :). When i was going to grab a screenshot of my screen i noticed "IE7 mode" had been turned on. Not sure how, but anyway - please close this thread and disregard my ramblings.

mankz
5 Apr 2013, 7:11 AM
Wait once more, now I retried this in a real IE7 and this is reproducible. Image attached. The column lines of the first row in a group is out of sync.

42952

slemmon
5 Apr 2013, 8:54 AM
Seems my instincts were correct. ;)

Thanks for the report! I have opened a bug in our bug tracker.