search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

onTimeRangeSelected: giving 3 value start/end/resource

Asked by Sapan Kumar
2 months ago.

onTimeRangeSelected: giving 3 value start/end/resource

how can i get more data, wanted access custom values like room category so on...

backend_rooms.php

foreach($rooms as $room) {
$r = new Room();
$r->id = $room['rm_no'];
$r->name = $room['rm_no'];
$r->rm_cat = $room['rm_Cat'];
$r->capacity = 2;
$r->status = $room['status_f'];
$result[] = $r;

}

header('Content-Type: application/json');
echo json_encode($result);

index.php/onTimeRangeSelected
How can i access rm_cat in onTimeRangeSelected event?

dp.onTimeRangeSelected = function (args) {
How can i access rm_cat here
//var name = prompt("New event name:", "Event");
//if (!name) return;
console.log ( args );
var modal = new DayPilot.Modal();
modal.closed = function () {
dp.clearSelection();

// reload all events
var data = this.result;
if (data && data.result === "OK") {
loadEvents();
}
};

Answer posted by Dan Letecky [DayPilot]
2 months ago.

The original data object is accessible as "data" property of the row object. You can get the row object (DayPilot.Row class) using .rows.find():

var row = dp.rows.find(args.resource);
var rm_cat = row.data.rm_cat;
New Reply
This reply is
Your name (optional):