Discuss anything related to web development but no technical support questions


Post by xjpmauricio »

Hi, is there a way i can programtically access all existing events on a specific row? by row index?

Thanks.

Post by mats »

Sure, by "row" do you mean only the visible events on the row or all events for that resource that have been loaded into the store? For the latter:
var resourceId = scheduler.store.getAt(someRowIndex).id;
var rowEvents = scheduler.eventStore.queryBy(function(ev) { return ev.get('ResourceId') === resourceId; });

Post by xjpmauricio »

Hi, i meant only the visible events on the row. Not the store itself.

Post by mats »

var resourceId = scheduler.store.getAt(someRowIndex).id,
      viewStart = scheduler.getStart(),
      viewEnd = scheduler.getEnd();

var rowEvents = scheduler.eventStore.queryBy(function(ev) { return ev.get('ResourceId') === resourceId && Date.intersectSpans(ev.get('StartDate'), ev.get('EndDate'), viewStart, viewEnd); });

Post Reply