Documentation

Calendar Grid View

Placements of CALENDAR_GRIDVIEW allows to customize calendar view (from the top - day/week/month/list).

Example

The app can be binded to calendar view as follows:

 BX24.callMethod('placement.bind', {
   PLACEMENT:'CALENDAR_GRIDVIEW',
   HANDLER: 'http://svd.org/svdapp.php',
   TITLE: 'Custom tab'
}, (result) => {console.log(result)});

Call inside the app

echo "<pre>";
print_r($_REQUEST);
echo "</pre>";

... and it receives the specific parameters, as follows:

[PLACEMENT_OPTIONS] => {
   "viewRangeFrom":"2018-09-30",
   "viewRangeTo":"2018-11-04"
}

Also, placement has a specific interface for methods and events.

Methods (JS methods)

Method Description
getEvents
Gets events
var dateFrom = new Date();
var dateTo = new Date(dateFrom.getTime() + 86400 * 30);
dateFrom.setHours(0, 0, 0, 0);
dateTo.setHours(0, 0, 0, 0);

BX24.placement.call('getEvents', {
   dateFrom: dateFrom,
   dateTo: dateTo
   }, function(events)
{
   console.log('getEvents responce:');
   console.dir(events);
});
viewEvent
View event (open event detail view)
BX24.placement.call('viewEvent', {
       id: "1431170", - event id
       dateFrom: "11.07.2018" - date of event (optional, but important for regular events)
},
function(){});
addEvent
Adds new event (open details)
BX24.placement.call('addEvent', function(){});
editEvent
Edits event (open details)
BX24.placement.call('editEvent', {uid: "1431171|19.07.2018"}, function(){});
deleteEvent
Deletes events
BX24.placement.call('deleteEvent',
{
   id: "1431169"
},
function(){});

Events that can be traced in placement

Events Description
Calendar.customView:refreshEntries Updates events.
Calendar.customView:decreaseViewRangeDate Click backspace pointer, i. e. move backwards the calendar to previous dates (which specifically - can be decided by the placement's author).
Calendar.customView:increaseViewRangeDate Click forward pointer, i. e.move forward the calendar to next dates (which specifically - can be decided by the placement's author).
Calendar.customView:adjustToDate Switches to specific date (it is passed in the parameter).


Additional information

Application Embedding (REST).



© «Bitrix24», 2001-2024
Up