Results 1 to 1 of 1

Thread: [Answers] Calendar

  1. #1
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135

    [Answers] Calendar

    Q:
    I need to filter the data for the calendar section based on a public variable. I cannot find a similar "Where Condition" attribute for the calendar section?
    A:
    Filter





    Q:
    Is there a
    variable or attribute that stores the current month and year displayed in calendar section
    A:
    When you specify a "Click delegate" for the calendar section in the attributes, when the user clicks on an event or clicks on a calendar cell the click delegate is called with a JSON encoded string as an argument.
    In your case, as you are building a desktop App you can use json_decode() to decode the argument into an object.
    This object then has members:
    start_date
    end_date
    start_time
    end_time
    You can look at the object using json_decode( arg )
    Example desktop calendar click delegate:
    proc myCalendarClickDelegate( arg )
    ? json_decode(arg)
    endproc




    Q:
    I notice under the calendar options the following attributes
    a) Click Delegate
    b) Dynamic day backcolor
    c) Dynamic event backcolor
    d) Dynamic event forecolor
    In my case, my table has a field that indicate the type of shift and I want to
    color the days in a month based on the shift type
    A:
    As the calendar is being rendered, for each record the "delegate" functions for the dynamic coloring are called. When they are called the active record is in the currently selected cursor.
    You can therefore just inspect the fields in the record (or lookup some other data in another table) and return a color code. This color code is a string and can be any of the standard web colors e.g. "pink", "lightgreen" etc or it can be a HTML/CSS style color code e.g. "#cfcfcf".
    The delegate settings are in the attributes. See below.


    If you read the source code of calendar_view.rsp in the library directory you will see how this is achieved.
    Also notice in the screenshot that "Event Type choices" determine what appears in the drop down list and also the color that corresponds to that type of event.




    All topics in [Answers] alphabetically: http://www.lianja.com/community/show...ll=1#post12352
    Last edited by josipradnik; 2016-03-02 at 03:03.

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us