Hey Community,
first day of the week and problems are rising. Anyway, I need your help. My grid panel is not aligned properly if I load 20+ rows. Any ideas on why is this behaving this way?
align2.JPG
Here is a snippet of my code:
How I made my grid panel:
Code:
var storeFields = Schedule.Calendar.panels.CallbackPanel.getDates(2);
storeFields.unshift('time');
Ext.define('CallbackModel', {
extend: 'Ext.data.Model',
fields: storeFields
});
var callbackdata = Ext.create('Ext.data.Store', {
storeId:'callback-data',
model: 'CallbackModel',
data: Ext.create('Schedule.Calendar.data.CallbackData'),
//autoLoad : true,
//pageSize: 20,
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});
callbackdata.load({
params:{
start:0,
limit: 10
}
});
var cm = Schedule.Calendar.panels.CallbackPanel.getDates(1);
cm.unshift({ header: 'Time', dataIndex: 'time', width: 100, sortable: false});
this.callbackTable = Ext.create('Ext.grid.Panel', {
id: 'callback-table',
store: callbackdata,
columns: cm,
stripeRows : true,
autoScroll: true,
columnLines: true,
listeners:{
cellclick:
function(table, td, columnIndex, record, tr, rowIndex, e) {
me.active_column = columnIndex;
},
itemclick:
function(grid, record, item, index, event){
me.active_time = record.get('time');
}
},
dockedItems : [ {
xtype : 'pagingtoolbar',
hight : 28,
store: callbackdata,
displayInfo : true,
dock : 'bottom'
}],
x: 0,
y: 0,
width: 1000,
height: 435
});
"Schedule.Calendar.panels.CallbackPanel.getDates(2)" will return a array something like this " ['col-1', 'col-2', 'col-3',...'col-31'] " and that is for the columns.
As for "Schedule.Calendar.panels.CallbackPanel.getDates(1)" will retrun an array something like this
Code:
[
{ header: 'Time', dataIndex: 'time', width: 100, sortable: false},
{ header: '1', dataIndex: 'col-1', flex: 1, sortable: false},
{ header: '2', dataIndex: 'col-2', flex: 1, sortable: false}............
{ header: '31', dataIndex: 'col-31', flex: 1, sortable: false}
]
and this is my initial data:
Code:
var myData = {'items' : [
{'time': '0:00'},
{'time': '0:30'},
{'time': '1:00'},
{'time': '1:30'},
{'time': '2:00'},
{'time': '2:30'},
{'time': '3:00'},
{'time': '3:30'},
{'time': '4:00'},
...........................,
{'time': '23:30'}
]}
Please help guys. I have no idea why is this happening.