Our pure JavaScript Scheduler component


Post by rcon »

I have a resourceStore with users and a cellMenu with an option to checkout with the following

	onItem: (user) => this.checkOut(user.id)

What would be the best aproach to update the resourceStore inside my checkOut() function?


Post by mats »

What is user in this context? Could you please share full code showing your Scheduler definition / instantiation?


Post by rcon »

  <bryntum-scheduler
    ref="scheduler"
    v-bind="schedulerConfig"
    :barMargin="barMargin"
    :stripeFeature="stripe"
    :columnLinesFeature="columnLines"
    :listeners="listeners"
    :features="features"
    :resourceTimeRanges="resourceTimeRanges"
  />
  
//schedulerConfig const useSchedulerConfig = () => { return { startDate : new Date(2021, 0, 11, 0), endDate : new Date(2021, 0, 11, 20), viewPreset : 'hourAndDay', rowHeight : 50, barMargin : 5, multiEventSelect : true, resourceImagePath : 'users/', columns : [{ text: 'Name', field: 'name', width: 130 }], resources : [], events: [], }; }; // push users to 'this.schedulerConfig.resources' onUsersUpdate(usersData) { let _tutorials = [] usersData.forEach((user) => { let data = user.data() _tutorials.push({ id: data.id, name: data.name, dataId: user.id, orderNum: data.orderNum, }) }) this.schedulerConfig.resources = _tutorials

If I simply loop through this.$refs.scheduler.instance.value.resourceStore like this

this.$refs.scheduler.instance.value.resourceStore.forEach(user =>{
	user.name = 'something'
})

Is it the right way to do it?

Doing this is trigering a 'remove' action instead of an 'update' one


Post by mats »

Yes that looks right, any chance you can upload a full sample with (dummy) data so we can debug it live?


Post Reply