Jump to content

CalendarPanel -> fireing DateChange event


Recommended Posts

Hello everyone,


i'm in trouble with personalization of client graphic issue of uniCalendarPanel.

After some studing of js, extj and js-client-event, i have reached the goal of assign some new class to day cell of the calendar on the event datachange of the calendarpanel object.

So i can change month in monthview and the event DateChange make the right work.


My problem occur after login and after coming back to the calendar pannel after validation of an other form. In these two cases i need to fireup the event manually. I can't figure how to implement this beaviour.


I think the correct js code is 

<my unicalendarpanel object identifyer>.fireEvent('DateChange', myStartDate, myStartWiewDate, myEndWiewDate);

i can use it in a UniSession.addJS or in client-event to run the command, but can't find the correct moment to do that.


During the login the mainform of the app is just redered and the code in DateChange event is just runned. After login when the mainform and unicalendarpanel object are shown at the client screen, the graphic is re-redered, but no event is fired (at list i beleave that or can't find that).


thanks a lot,

and sorry for my bad english.


Link to comment
Share on other sites

the login form is rendered "over the main form" so beforerender/render/afterrender are all fired before login is confrmed. 

When the mainform (with calendar panel of course) is showed whitout re-firing render's family event, 


I'm not able to explane better :(  .... i'm put an alert on beforerender, the message appear during Loading (with uni square icon) , before aniting is showed.


I try to use active event, but this event is fired to many time and slowly down the real rendering of the form.




Link to comment
Share on other sites

ok , i've just added my e-mail into the customer portal. (my CTO have bought the license)


@FarshadMohajeri: i'm developopig over a platform that was alredy developed by some one else. that person also have incloude some delphi classes that work for desktop application, so I can not rewrite all the web application.


@DelphiDeveloper: unfortunately is to strong to replicate the behavior in a new sample project, I try to do that tomorrow, I think there are to layer, classes and sublasses, to replicate and simplify.  


However i think I've found solution: putting the following code to call event from AfterShow event of mainform and on the call backfunction from the other form (that is opened over the mainform, so the unicaldar are not redraw automatically): 

UniSession.AddJS( 'var bound = '+uniCalendar1.JSName + '.getActiveView().getViewBounds();'+
      uniCalendar1.JSName + '.fireEvent(''DateChange'','+uniCalendar1.JSName + ', '+uniCalendar1.JSName + '.getActiveView().getStartDate( ), bound.start, bound.end);' );

It seems to work, having some diffcult on callback function...come back soon to give you the response.



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...