Our pure JavaScript Scheduler component


Post by erobishaw »

I'm getting the dreaded:

Deprecation warning: You are using a deprecated API which will change in v6.0.0. `gridRowDrop` event is deprecated, listen on this event on the Grid instead.

But I can't find any help in the docs on how to replace this call... what's the equivalent updated code needed?

This is the offending code, where I'm setting the rowReorderFeature config to this:

 public reorderFeatures1 = {
    showGrip : true,
    listeners : {
      gridRowDrop : async ({ context }) => {
          // Here you have access to context.insertBefore, and additionally context.parent for trees
          //console.log(context);
          if(context.valid) {
             //do stuff
        }
      }
    }
  }

Post by mats »

Put this bit on your Grid config instead:

listeners : {
      gridRowDrop : async ({ context }) => {
          // Here you have access to context.insertBefore, and additionally context.parent for trees
          //console.log(context);
          if(context.valid) {
             //do stuff
        }
      }
    }

Post by erobishaw »

thanks... the message actually says that "list to this event on the Grid instead"...

But how do I reference the schedule's grid in angular....?
i.e, I'm setting this config setting as the row order feature like this:

<bryntum-scheduler #scheduler2
...
[rowReorderFeature]="reorderFeatures1"


</bryntum-scheduler >

How does one set the config for the schedule's grid?


Post by marcio »

Hey erosbishaw,

Instead of using the listeners' configuration in the rowReorderFeature, you should use it directly in the Scheduler, as it's explained here https://bryntum.com/products/scheduler/docs/guide/Scheduler/integration/angular/events

So you'll have something like this

public reorderFeatures1 = {
    showGrip : true
  }
  
public handleOnGridRowDrop = async ({ context }) => { // Here you have access to context.insertBefore, and additionally context.parent for trees //console.log(context); if(context.valid) { //do stuff } } <bryntum-scheduler #scheduler2 ... [rowReorderFeature]="reorderFeatures1" (onGridRowDrop)="handleOnGridRowDrop" </bryntum-scheduler >

https://bryntum.com/products/scheduler/docs/api/Grid/view/GridBase#eventhandler-onGridRowDrop

Best regards,
Márcio


Post by erobishaw »

got it... thanks!


Post Reply