Our pure JavaScript Scheduler component


Post by chaithanya.gopidi »

I am using CrudManager to sync up the Bryntum Dependencies Scheduler tasks. I want to receive all the tasks and resources when I drag and drop one of the task from one resource to another resource on the grid.
I have tried following but couldn't succeed to get all tasks however I am only receiving updated resource and task startdate and enddate and id.
I have tried following ways

var finaldata ;
 sync : {
                    	url : '../../../../../../../LoadSimulationData2',
                        params : {
                        	// console.log(this.taskStore.data),
                        	start : startdate,
                        	end : endate,
                        	tlarea : area,
                        	finaldata :this.taskStore.data,
                        	result : simulationresult
                        }
}

sync : {
                    	url : '../../../../../../../LoadSimulationData2',
                        params : {
                        	start : startdate,
                        	end : endate,
                        	tlarea : area,
                        	finaldata :this.getEventStore().getRange(0,100),
                        	result : simulationresult
                        }
                    }

Could you please let me know how to proceed.

Thanks in Advance,
Chaithanya


Post by pmiklashevich »

I want to receive all the tasks and resources when I drag and drop one of the task from one resource to another resource on the grid.

Please see https://www.bryntum.com/docs/scheduler/#Scheduler/feature/EventDrag#event-afterEventDrop

scheduler.on({
    afterEventDrop({eventRecords, assignmentRecords}) {
        eventRecords.forEach(event => console.log(event.resources))
    }
})

I'm not sure what you're going to do with the received data. When drop happens the data in the store is modified. You can either call crudManager.sync() on afterEventDrop to send it to server. Or as an alternative configure crudManager to autoSync changes.

Pavlo Miklashevych
Sr. Frontend Developer


Post by chaithanya.gopidi »

@pmiklashevich, Thank you very much for your response to my query. Although I have following settings

Ext.apply(me, {
            crudManager : {
                autoLoad        : true,
                autoSync : true,
                dependencyStore : new Sch.data.DependencyStore(),
                transport       : {
                    load : {
                    	url : '../../../../../../../LoadSimulationData',
                        params : {
                        	start : startdate,
                        	end : endate,
                        	tlarea : area,
                        	result : simulationresult
                        }
                    },
                    sync : {
                    	url : '../../../../../../../LoadSimulationData2',
                        params : {
                        	start : startdate,
                        	end : endate,
                        	tlarea : area,
                        	result : simulationresult
                        }
                    }
                },

Autosync is already enabled and I get the response when I drag and drop the task from one resource to another resource. this response from bryntum is having only updated task information However when task is dragged and dropped I need complete taskstore to be sent from bryntum grid back to server . Could you please enlight me on this.

Thanks & Regards,,
Chaithanya


Post by mats »

  1. Please post code in CODE tags.

2.

However when task is dragged and dropped I need complete taskstore to be sent from bryntum grid back to server

You want to send all the contents of all the records in the taskStore after a drag drop? This is not something we support, what's the usecase?


Post by chaithanya.gopidi »

Hello Mats,

one use case where we want to drag task from one resource to other resource and want to export complete grid data and persist in database.
CrudManager Sync will get us only updated resource details with event, however I want to retrieve all the grid events and resources from bryntum. Could you please enlight me as to proceed.

Thanks & Regards,
Chaithanya


Post by mats »

You can just do

scheduler.resourceStore.toJSON()

and same for eventStore to get all contents as JSON.

https://bryntum.com/docs/scheduler/#Core/data/Store#function-toJSON


Post Reply