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

Testing the status of a room while selecting a timerange

Asked by Jean Pierre SOMDA
8 years ago.

How to access the properties of a resource while selecting a timerange?
we have args.resource wich is the resource id and we want to access dp.resources[x].yyyy (i imagine)!...
The gool is to cancel a selection if the status of the resource doesn't allow to process the selection.

Answer posted by Dan Letecky [DayPilot]
8 years ago.

If you store the resource status in dp.resource[].tags object you will be able to access it like this:

dp.resources = [
  { name: "Resource 1", id: 1, tags : {disabled: true } }
];

// ...
dp.onTimeRangeSelecting = function(args) {
  var row = dp.rows.find(args.resource);
  var disabled = row.tags && row.tags.disabled;
  if (disabled) {
    args.allowed = false;
  }
};
This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.