how to I add eventClick to a custom view event? like in this example? - custom-view

I wonder how do I add eventclick to a custom view event like in this sample so when I click the event the eventClick event is fired?
I tried adding publiclyTrigger to onClick event but this does not work either!
here the sample or custom view but there is no information how to fire eventClick from a custom view event!
https://fullcalendar.io/docs/custom-view-with-js-demo
I do appreciate this info! thanks a lot!
expecting a clear sample of custom view including fire event like eventClick

Related

Don't create a new event on eventReceive with Full Calendar

I'm working on a page where events are creating by dragging from a list onto a full calendar object. I'm then opening a dialog (bootstrap modal) to let the user edit the event.
During the edit, they might change the date or time of the initial drop. They could also conceivably cancel the event creation.
What I'd like to do is:
Don't create the initial event and just save after the modal is responded to. That is, I'd like eventReceive to fire, so I can trap it, but not have FullCalendar add the event to the calendar.
It's all here, just not in a 'recipe' manner: https://fullcalendar.io/docs/external-dragging
Set create to false in the Draggable and handle the drag with the drop event.

Add a button to an event to confirm it's done

So basically I want to add a button to every event, that changes a value in a php database.
So in the event in the day view, I want a button that does something when you click! I can't add a button to the event layout. Thanks in advance.

button events in datalists

I have a datalist and want to dynamically add buttons to it. I am using the OnItemCommand datalist event and setting the CommandName/ CommandArgument attributes of the button.
However I am having trouble with handling the button click - does not seem to fire.
It works when I declared a button on the aspx page, but not for buttons that are dynamically created.
I hope this makes sense, and any help would be great.
Thanks
You can only create dynamic controls on PreInit or Init if you want to handle associated events. Otherwise, on postback, they won't exist at the moment of event handling and because of that, your handler method won't be called.
Internet is full of resources about how to handle dynamic controls. Let me know if you need any reference.

Adding controls to page on PreRender

Do you know any drawback to add controls to a page on PreRender event?
please don't answer 'depends on your case' I'm talking in general:-)
The PreRender event happens after control events, so the control could not use any events.
If you for example add a Button in Page_PreRender, it's too late to hook up a Click event handler for it. At postack the button would not be recreated until after the click event had already been handled (and ignored).
Yes, see this link for the ASP.NET lifecycle:
http://msdn.microsoft.com/en-us/library/ms178472.aspx
I would recommend adding controls on the Init event as the new control would otherwise be cleared on any postbacks. This is as per https://web.archive.org/web/20210330142645/http://www.4guysfromrolla.com/articles/092904-1.aspx.
'Raised after all controls have been initialized and any skin settings have been applied. Use this event to read or initialize control properties.'

When a button is clicked, will then button's event fire before page_load?

When an asp.net button is fired, will the button's event get fired before the page_load and init and pre_init events?
http://msdn.microsoft.com/en-us/library/ms178472.aspx
Page_Load goes before event handlers.
Just stick some breakpoints in the different functions and see which one fires first. I think the answer is no.
Make a page with page init, load (also variations of ispostback), prerender, unload and control events and do a trace to see when they all fire off - easier to remember too when you do it as opposed to reading it.
Page_Load, init and pre_init will happen before the button can receive any user input, so it will definitely happen before the button can fire off any events as a result of user input.

Resources