Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    HowTo: Disable and/or edit hover on Calendar cells (3.0)

    How can we edit the hover text for a calendar cell with events in it? At the very least, how can we disable it, alter what fields are shown, or something?

    As it is now, the hover will scroll off the page, is unreadable due to too much data and lack of formatting, etc. Also, when it does go beyond the page boundaries, it introduces scroll bars and after that, the hover will be stuck in the top left corner of the page.

    #2
    So we've added access to an event that should allow you to accomplish the behaviour you are looking for. It will be available with tonight's nightly builds (after aprox 2AM PST on 12-2-2012). The fix has been done against 3.0, 3.1 and onward.

    The fix provides you with a new event that you can provide a handler for. Sample code below gives you a rudimentary example.

    Calendar calendar = new Calendar();
    calendar.setWidth100();
    calendar.setHeight100();
    calendar.addEvent(new Date(new Date().getTime()+360000), new Date(new Date().getTime()+720000), "Party Time", "Blah");
    calendar.setCanHover(true);
    calendar.addEventHoverHTMLHandler(new EventHoverHTMLHandler() {
    @Override
    public void onEventHoverHTML(EventHoverHTMLEvent event) {
    SC.say("Hover Event");
    }
    });
    calendar.draw();

    Comment


      #3
      Perfect... but who is this?

      Comment


        #4
        Not sure why it has my last post as Guest.

        Comment


          #5
          Hi. I tried the function and this function doesn't really do what is needed.

          We aren't looking for customizing the hover for a particular event (although that is nice). We are trying to format or disable hovers on calendars completely - especially for month views.

          As it stands now, when viewing a monthly calendar, there appears to be no way to control what is shown in the hover for a day and/or to disable that hover.

          One of the problems is the hover is bugged in its current implementation. If there are lots of events for that day, the hover will go off the page, create scroll bars and on some browsers, the hover will get stuck on the screen in the upper left corner and never go away.

          How can we disable or edit the monthly day hover?

          Comment


            #6
            There's not currently an API for customizing (or disabling) that hover.
            We agree there should be and are adding one. ETA is currently next week some time. We'll update this thread when it's in place.

            Comment


              #7
              Thank you for the update.

              Comment


                #8
                We now have an API for this - see setMonthViewHoverHTMLCustomizer()
                This should be present in the latest nightly build 4.0d branch

                Regards
                Isomorphic Software

                Comment


                  #9
                  Any chance this can be added to 3.0, or at the very least, 3.1?

                  We can't move to 4.0 for our clients at this point.

                  And thank you for adding this.

                  Comment


                    #10
                    The backport to 3.0 and 3.1 is in track and has an estimated completion of mid to early next week.

                    Matt

                    Comment


                      #11
                      Hi team,
                      Any update on this or do we think it is something that will hit sometime after the holidays?

                      Comment


                        #12
                        Sorry for the lack of a preemptive update - yes this is still ongoing, should be complete right after Christmas if not sooner. The way this was implemented in 4.0 didn't translate easily to 3.1, so it was more work than expected.

                        Comment


                          #13
                          This should now be present in nightly builds going forward on the 3.0 and 3.1 branches
                          Please let us know if you don't see it in nightlies dated Dec 27 or greater

                          Regards
                          Isomorphic Software

                          Comment


                            #14
                            The setMonthViewHoverHTMLCustomizer() exists but has no effect in SmartGWT 3.1p (smartclient version v8.3p_2013-05-09).

                            I looked into the source and found the issue. For SmartGWT 4.0d latest nightly (SNAPSHOT_v9.0d_2013-05-09) the file ISC_Calendar.js contains:

                            Code:
                            isc.A.cellHoverHTML=function isc_MonthSchedule_cellHoverHTML(_1,_2,_3){
                              var _4=this.fields.get(_3).$66b;
                              var _5=_1["date"+_4];
                              var _6=_1["event"+_4];
                              if(!this.rowIsHeader(_2)&&_6!=null){
                                var _7=this.creator;
                                return _7.getMonthViewHoverHTML(_5,_6)
                              }
                            }
                            For SmartGWT 3.1p latest nightly it contains:
                            Code:
                            isc.A.cellHoverHTML=function isc_MonthSchedule_cellHoverHTML(_1,_2,_3){
                              var _4=this.fields.get(_3).$66b;
                              if(!this.rowIsHeader(_2)&&_1["event"+_4]!=null){
                                var _5=_1["event"+_4];
                                var _6="";
                                for(var i=0;i<_5.length;i++){
                                   var _8=isc.Time.toTime(_5[i][this.creator.startDateField],this.creator.timeFormatter,true);
                                   _6+=_8+" "+_5[i][this.creator.nameField]+"<br/>"
                                }
                                return _6
                              }
                            }
                            Based on last Isomorphic post I expected this to present in the 3.1 branch. Please add this to 3.1 if at all possible.
                            Thanks.

                            Comment


                              #15
                              Hi,

                              I need this too in 3.1. Checked in 2013-05-13, still no effect.

                              Many thanks, Ben.

                              Comment

                              Working...
                              X