The Calendar widget seems to ignore setCanDragEvent(false) and setCanDragResize(false). Using the sample code I added the 2 lines to disable dragging of events, but this seems to be ignored, I still can drag and drag-resize the events:
In my case I need to have the calendar and events to be editable (even so the user can't edit them) in order to allow the user to select an individual event of a day in the month view. This however results in the above behaviour (which I don't want).
(I added an EventMovehandler and cancel the event in onEventMoved. The result is that the user can drag an event, ie the outline is drawn when dragging, but nothing happens. This looks silly...)
I'm using GWT 2.3 and SmartGWT 2.5
Code:
package smartgwtcalendar.client; import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.data.fields.DataSourceDateTimeField; import com.smartgwt.client.data.fields.DataSourceSequenceField; import com.smartgwt.client.data.fields.DataSourceTextField; import com.smartgwt.client.widgets.calendar.Calendar; public class SmartGWTCalendar implements EntryPoint { @Override public void onModuleLoad() { DataSource eventDS = new DataSource(); DataSourceSequenceField eventIdField = new DataSourceSequenceField("eventId"); eventIdField.setPrimaryKey(true); DataSourceTextField nameField = new DataSourceTextField("name"); DataSourceTextField descField = new DataSourceTextField("description"); DataSourceDateTimeField startDateField = new DataSourceDateTimeField("startDate"); DataSourceDateTimeField endDateField = new DataSourceDateTimeField("endDate"); eventDS.setFields(eventIdField, nameField, descField, startDateField, endDateField); eventDS.setClientOnly(true); eventDS.setTestData(CalendarData.getRecords()); Calendar calendar = new Calendar(); calendar.setDataSource(eventDS); calendar.setAutoFetchData(true); calendar.setCanDragEvents(false); calendar.setCanDragResize(false); calendar.draw(); } }
(I added an EventMovehandler and cancel the event in onEventMoved. The result is that the user can drag an event, ie the outline is drawn when dragging, but nothing happens. This looks silly...)
I'm using GWT 2.3 and SmartGWT 2.5