PDA

View Full Version : Object [object Object] has no method 'addCellTpl'



chinnib37
28 May 2013, 2:45 AM
Hi,
I am using timeresolution plugin in my application. But I am getting following error.
Object [object Object] has no method 'addCellTpl'

I am unable to solve it.
Help me to resolve this problem.

my code is

Scheduler = {
// Initialize application
init : function() {


Ext.define('Event', {
extend : 'Sch.model.Event',

// Reuse the resource id for CSS styling
clsField : 'ResourceId',


fields : [
{name: 'Title'}
]
});


var resLabel = new Ext.form.Label({
style : 'font-weight:bold',
text : 15
}),
tip = new Ext.slider.Tip({
getText: function(thumb){
return Ext.String.format('<b>{0} minutes</b>', thumb.value);
}
}),
eventStore = new Sch.data.EventStore({
model : 'Event',
data : [
{ResourceId: 'MadMike', Title : 'Assignment 1', StartDate : "2010-12-09 10:00", EndDate : "2010-12-09 11:00"},
{ResourceId: 'LindaAnderson', Title : 'Assignment 2', StartDate : "2010-12-09 10:00", EndDate : "2010-12-09 12:00"},
{ResourceId: 'DonJohnson', Title : 'Assignment 3', StartDate : "2010-12-09 13:00", EndDate : "2010-12-09 15:00"},
{ResourceId: 'KarenJohnson', Title : 'Assignment 4', StartDate : "2010-12-09 16:00", EndDate : "2010-12-09 18:00"},
{ResourceId: 'DougHendricks', Title : 'Assignment 5', StartDate : "2010-12-09 12:00", EndDate : "2010-12-09 13:00"},
{ResourceId: 'PeterPan', Title : 'Assignment 6', StartDate : "2010-12-09 14:00", EndDate : "2010-12-09 16:00"}
]


/* proxy : {
type : 'ajax',
url : 'data.js'
}*/
});


var colSlider = Ext.create("Ext.slider.Single", {
width: 100,
value: 0,
minValue: 0,
maxValue: 10,
increment: 1
});


var sched = new Sch.panel.SchedulerGrid({
height : ExampleDefaults.height,
width : ExampleDefaults.width,
eventBarTextField : 'Title',
viewPreset : 'hourAndDay',
startDate : new Date(2010, 11, 9, 8),
endDate : new Date(2010, 11, 9, 16),
eventResizeHandles : 'both',
snapToIncrement : true,
rowHeight : 30,
viewConfig : { loadMask : true },
tbar : [
{
xtype : 'label',
text : '5 min'
},
' ',
new Ext.slider.SingleSlider({
style:'margin-left:10px',
width: 100,
value: 15,
increment: 5,
minValue: 5,
maxValue: 60,
plugins: tip,


listeners : {
change : function(s, v) {
sched.getSchedulingView().setTimeResolution(Sch.util.Date.MINUTE, v);
resLabel.setText(v);
},
afterrender: function() {
this.setValue(sched.getSchedulingView().getTimeResolution().increment);
}
}
}),
' ',
{
xtype : 'label',
text : '60 min'
},
' ',
{
xtype : 'label',
text : 'Zoom out'
},
' ',
new Ext.slider.SingleSlider({
style:'margin-left:10px',
width: 100,
value: 0,
increment: 1,
minValue: 0,
maxValue: 10,
listeners : {
change : function(s, v) {
sched.zoomToLevel(v);
},
afterrender: function() {
this.setMinValue(sched.minZoomLevel);
this.setMaxValue(sched.maxZoomLevel);
this.setValue(sched.getCurrentZoomLevelIndex());
}
}
}),
' ',
{
xtype : 'label',
text : 'Zoom in'
},
'->',
{
text : 'Snap to increment',
enableToggle : true,
pressed : true,
handler : function() {
sched.getSchedulingView().setSnapEnabled(this.pressed);
}
}
],


// Setup static columns
columns : [
{header : 'Name', sortable:true, width:100, dataIndex : 'Name'}
],

// Store holding all the resources
resourceStore : new Sch.data.ResourceStore({
model : 'Sch.model.Resource',
data : [
{Id : 'MadMike', Name : 'Mike'},
{Id : 'LindaAnderson', Name : 'Linda'},
{Id : 'DonJohnson', Name : 'Don'},
{Id : 'KarenJohnson', Name : 'Karen'},
{Id : 'DougHendricks', Name : 'Doug'},
{Id : 'PeterPan', Name : 'Peter'}
]
}),

// Store holding all the events
eventStore : eventStore,

onEventCreated : function(newEventRecord) {
// Overridden to provide some defaults before adding it to the store
newEventRecord.set('Title', 'Hello...');
}
});


sched.render('example-container');
sched.eventStore.load();
}
};


Ext.onReady(function() {
Ext.QuickTips.init();
Scheduler.init();

});

slemmon
30 May 2013, 9:12 AM
It looks like you're working with a Bryntum product, yes?
I suspect the best place to pose the question will be here:
http://www.bryntum.com/forum/