iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
HI,all
can I make the overdue Event can not be edited?
for example:
I creat a event that occur at 09:00 today and I can not edit it after 09:00 tomorrow!
thanks!
Hi,
I found another way to achieve the scenario with more simple code.
function WebScheduler1_OnEventBound(controlId, evt) { var WebScheduler1 = ISGetObject(controlId); var dTime = new Date().getTime(); if (evt._Type == "WebSchedulerEventView") { var sTime = evt.StartTime.getTime(); if (Math.abs(dTime - sTime) / 86400000 > 1) { evt.DisableEdit = true; evt.DisableDelete = true; evt.DisableMove = true; evt.DisableResize = true; } } return true; } function WebScheduler1_OnAfterAdd(controlId, evt) { var WebScheduler1 = ISGetObject(controlId); window.setTimeout(function() { WebScheduler1.Refresh(); }, 100); return true; }
Regards,Handy
You will need to validate and calculate the different times at OnCallOutShow and OnContextMenu clientside event. If the validation is valid, hide the edit/delete button or contextmenu.
Here is the snippet codes. Hope this helps.
function WebScheduler1_OnCallOutShow(controlId, action) { var WebScheduler1 = ISGetObject(controlId); var dTime = new Date().getTime(); if(action!="Add") { var sTime = WebScheduler1.GetSelectedEvent().StartTime.getTime(); if (Math.abs(dTime - sTime) / 86400000 > 1) { WebScheduler1.GetCallOutEditButton().style.display = "none"; WebScheduler1.GetCallOutDeleteButton().style.display = "none"; } } return true; } function WebScheduler1_OnContextMenu(controlId, type, menuObj, el, eventView) { var WebScheduler1 = ISGetObject(controlId); var WebScheduler1 = ISGetObject(controlId); var dTime = new Date().getTime(); if (eventView != null) { var sTime = WebScheduler1.GetSelectedEvent().StartTime.getTime(); if (Math.abs(dTime - sTime) / 86400000 > 1) { menuObj.Items.GetNamedItem("mnuEdit").Disable(); menuObj.Items.GetNamedItem("mnuDelete").Disable(); } } return true; }
Handy,
It appears that both codes you provided above prevent all events, including future events, from being edited. Could you please revise so that only overdue events (i.e. past today) cannot be edited.
Thanks
Jean
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname