Hi all,
I’m trying to integrate vaadin with Extjs scheduler…Here I’m successfully loading EXTjs UI onto the screen but the problem is handling the event…i’m unable to call vaadin callback function…
Any suggestions,help will be needfull…code details are
[code]
@SuppressWarnings(“serial”)
@Theme(“vaadinscheduler”)
public class VaadinschedulerUI extends UI {
@WebServlet(value = "/*", asyncSupported = true)
@VaadinServletConfiguration(productionMode = false, ui = VaadinschedulerUI.class)
public static class Servlet extends VaadinServlet{
}
@Override
protected void init(VaadinRequest request) {
final VerticalLayout v=new VerticalLayout();
SchedulerComponent sc=new SchedulerComponent();
v.addComponent(sc);
setContent(v);
}
}
[/code](Server component)
SchedulerComponent.java
[code]
@JavaScript({“ext-all.js”,“sch-all-debug.js”,“Schdeuler.js”,“sch-all.js”})
@StyleSheet({“examples.css”,“ext-theme-classic-all.css”,“sch-all.css”,“style.css”})
//@JavaScript({ “Schdeuler.js” })
public class SchedulerComponent extends AbstractJavaScriptComponent {
@Override
public SchedulerState getState(){
return (SchedulerState) super.getState();
}
public SchedulerComponent(final VerticalLayout v){
addFunction("sch", new JavaScriptFunction() {
@Override
public void call(JsonArray arguments) throws JSONException {
// TODO Auto-generated method stub
Notification.show("hiiiii");
}
});
}
}
/code
Schdeuler.js
com_example_vaadinscheduler_SchedulerComponent=function(){
var e=this.getElement();
var self=this;
var bb=self.sch;// [color=#FF0000]
i'm unable to call vaadin callback functiona
[/color]
console.log(bb);
var resourceStore = new Sch.data.ResourceStore({
sorters : 'Name',
data : [
{Id : 'r1', Name : 'Mike'},
{Id : 'r2', Name : 'Linda'},
]
});
// Store holding all the events
var eventStore = new Sch.data.EventStore({
data : [
{
ResourceId : 'r9',
StartDate : "2011-02-16 12:00",
EndDate : "2011-02-16 16:00"
},
{
ResourceId : 'r2',
StartDate : "2011-02-17 08:00",
EndDate : "2011-02-17 14:00"
}
]
});
var sch=Ext.create('Sch.panel.SchedulerGrid',{
width:1000,
height:400,
title : 'Employee Time Scheduler',
border : true,
viewPreset : 'hourAndDay',
rowHeight : 30,
enableDragCreation : false,
constrainDragToResource :true,
allowOverlap : false,
renderTo:e,
startDate : new Date(2011, 1, 14),
endDate : new Date(2011, 1, 20),
//selModel : sm,
resourceStore : resourceStore,
eventStore : eventStore,
eventRenderer : function (event, r, tplData, row, col, ds) {
console.log('inside eventRenderer');
return Ext.Date.format(event.getStartDate(), 'G:i') + ' - ' + Ext.Date.format(event.getEndDate(), 'G:i')+"<br>"+event.get('Shift')+" "+event.getName( );
},
listeners:{
eventresizeend : function( scheduler, record, eOpts ){
console.log("inside eventresize");
var a=self.sch; //[color=#FF0000]
i'm unable to call vaadin callback function
[/color]
console.log(a);
console.log("eve resize");
}
}
});