Hi quick and simple and if anyone can let me know how to do it I would be grateful
Currently I am opening the dialog on double click and all is well but my client wants to open on a single click of the webdayview and I have scoured the forums and docs for an answer and found nada. can this be done?
Many thanks
Richard
Hi,
<script type="text/javascript">
function myClick(oDay, oEvent, src){ // next 3 lines are optional // check if "active" element is clicked var attr = src.getAttribute('uie'); if(attr.indexOf('SLOT') != 0 && attr.indexOf('LABL') != 0 && attr.indexOf('_ADA') != 0) return; // notify webdayview about faked dblclick event oDay._onHandleEvent(src, {type:'dblclick', myEvt:true});}
function myDblclick(oDay, oEvent, src){ // cancel real dblclick event, but keep faked event if(!oEvent.event.myEvt) oEvent.cancel = true;}
</script>
Regards,ViktorInfragistics web team
In previous email I included clicks converted to dblclicks only for elements which create new appointments, but not edit existing. If you want to edit old appointment on single click, then you may try to include other elements as well, like (attr.indexOf('_ADE') != 0) and others. The best way is to set break point in the ig_WebDayView.prototype._onHandleEvent and check which element for dblclick you are interested in.There in should be no difference in getting key and other stuff while processing click/dblclick events.
Hi Viktor
Thanks for replying again, I still dont see the double click event. With the code below I am seeing only the "single" alert when I click on either an empty cell or a cell with an activity on the webdayview, thus my doubleclick function is not being called. The "cancelled" alert is also not being called. Could it be a syntax error on the WebDayView_Click function?
function WebDayView1_Click(oDayView, oEvent, element){ alert("single"); // notify webdayview about faked dblclick event oDayView._onHandleEvent(src, {type:'dblclick', myEvt:true});}function WebDayView1_DblClick(oDayView, oEvent, element){ // cancel real dblclick event, but keep faked event if(!oEvent.event.myEvt) { oEvent.cancel = true; alert("cancelled"); } alert("double"); }
Hi Richard,
In your function name of 3rd param is "element", but you calloDayView._onHandleEvent(src, {type:'dblclick', myEvt:true});I expect that you should get exception. You should change name of param to "src", or replace "src" by "element" in _onHandleEvent.
Please insert at the beginning of your event handlers new linedebugger;and when debugger goes to that line, please hit F11 or F10. It will allow you to see what is going on and find out reasons for most problems. In javascript many things can go wrong and without debugging (direct, alerts, output to screen instant values, etc.) it is very hard to expect that codes will work as you intend.