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
I would like to know how I can pass the selected datetime into the custom form, that I created, when a user clicks on the empty cell in the timeline view.
Michael
Hi Michael,
In order to pass the selected datetime on the empty cell in the timeline view, You will need to use a ClientSideEvent OnCellSelected (You can find in the property of WebScheduler). Since You only want to retrieve the selected datetime in the timeline view, we need to make a validation first.
Here are the sample that I made in the client-side, using a TextBox to show a selected datetime on the selected empty cell in the timeline view.
function WebScheduler1_OnCellSelected(controlId, startDate, endDate, isAllDay, resource) { var WebScheduler1 = ISGetObject(controlId); if (WebScheduler1.ViewSettings.SelectedViewMode == "Timeline") { var text = document.getElementById("Text1"); text.value = startDate; } return true; }
Thank You,
Andi Santoso
Thanks. It helps. What if I want to pass the value into the iframe. I am using the editingDialogBox.
I am using this method for my project - http://intersoftpt.wordpress.com/2008/05/08/use-custom-editing-form-in-webschedulernet/
ThanksMichael
I assume you are creating a custom editing form. In order to pass the value into the IFrame, you need to use function window::onload() in your IFrame file.
Here are the sample code that i used to pass the start time value from an Event that has been clicked on the WebScheduler and assigned it in a simple TextBox.
function window::onload() { var txt = document.getElementById("Text1"); var ws = window.parent.ISGetObject("WebScheduler1"); txt.value = ws.SelectedEvent.StartTime; }
Thank you,
Hi Andi:
This doesn't work. I get "SelectedEvent is null" error message.
The error is occurred because you are selecting an empty cell instead of Event Cell . In order to pass the value from an empty selected cell, it is better if we use a client-side event function, which is “_OnEditingFormShow“ function, and I made a validation on the “eventType” either it is Event or Null.
Here are the sample code that I made. And remember, do not implement this code on the IFrame file, but implement this on your WebScheduler file.
function WebScheduler1_OnEditingFormShow(controlId, action, eventView, eventType, newType) { var WebScheduler1 = ISGetObject(controlId); if (eventType == "Event") { window.setTimeout(function() { window.parent.window [1].document.getElementById ("Text1").value = WebScheduler1.SelectedEvent.StartTime; }, 500); } else { window.setTimeout(function() { window.parent.window [1].document.getElementById("Text1").value = WebScheduler1.SelectedDateArea.title; }, 500); } return true; }
Thanks. This works.
Hi Andy,
I have the same problem as Michael, but for me your code doesn't work. I receive a null value i f I try to get SelectedArea.title from an empty cell, while it works if I retrieve it from an event already set. I post my code.
Thanks for your help,
Mino
Hi Mino,
I believe it is not working because you are not in the TimeLine view, because beside in that view, the "title" is set to null. That is why, in your code, try to put "WebScheduler1.StartDateSelection" instead of "WebScheduler1.SelectedDateArea.title". I hope it works for you, and please do not hesitate to ask if you have any more questions.
Thank you,Andi Santoso
Hi Andi,
thank you very much for your quick help, it was very useful and it seems to work. It just has a strange behaviour: if I click on an empty cell the first time since I opened the page, the parameter "date" is not passed to the editing form, while it works correctly all the next clicks. I posted my new javascript code and the screenshot with all the params keys passed to the editing form. Another question: could I change the title text of the editing form("New All Day Event" or "New Event") with a custom one?
Thanks in advance,
Mino.
It seems that I cannot replicate those behaviour, it works fine on me. Perhaps, sending the .aspx file would be a help for me to investigate further more. For changing the title of the editing box, first, we need to get to the object of the EditingDialogBox. Here are a sample code in client side _OnEditingFormShow that I made to change the caption.
function WebScheduler1_OnEditingFormShow(controlId, action, eventView, eventType, newType){ var WebScheduler1 = ISGetObject(controlId); if (eventType == "Event") { window.setTimeout(function() { window.parent.window [1].document.getElementById ("Text1").value = WebScheduler1.SelectedEvent.StartTime; }, 500); } else { window.setTimeout(function() { var dialogBox = ISGetObject("dlgEditing"); var setCapt = dialogBox.Window.SetCaption("Add New Event"); window.parent.window[1].document.getElementById("Text1").value = WebScheduler1.StartDateSelection; }, 10); } return true; }
I hope it helps, please do not hesitate to ask if you have any other questions.
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