I need some help!
I've registered an event in the row reordering and the drop event runs twice, is there a way to find out who's firing this second event?
Hey henrique,
You can see the documentation of drop event https://www.bryntum.com/docs/grid/api/Core/helper/DragHelper#event-drop
That we have a grabbed property which will have the information about the node which started the drag/drop action, is that the information that you're looking for?? Could you provide more context about how you set up the events?
Besides that, you could also try to add a breakpoint using dev tools, and then follow the function chain to check from where it was called.
Best regards,
Márcio
Sorry, isn't the another framework, but the hidden property of the grid.
In the sample below, every time you click in the button, and change the record position, will gerenate an event in the onGridRowDrop. If you click 5 time in the button, will generate 5 times the "passed here", in the console.
import { Button, Grid, DataGenerator, MessageDialog } from '../../build/grid.module.js?462345';
import shared from '../_shared/shared.module.js?462345';
const grid = new Grid({
appendTo : 'container',
features : {
rowReorder : {
showGrip : true,
callOnFunctions: true,
onGridRowDrop()
{
console.log("passed here");
}
}
},
// Headers will ripple on tap in Material theme
ripple : {
delegate : '.b-grid-header'
},
multiSelect : true,
columns : [{
text : 'Name',
field : 'name',
flex : 2,
editor : {
type : 'textfield',
required : true
}
}, {
text : 'Age',
field : 'age',
width : 100,
type : 'number'
}, {
text : 'City',
field : 'city',
flex : 1
}, {
text : 'Food',
field : 'food',
flex : 1
}, {
text : 'Color (not sortable)',
field : 'color',
flex : 1,
sortable : false,
renderer : ({ cellElement, value }) => {
// renderer that sets text color = text
cellElement.style.color = value;
return value;
}
}],
tbar : [
{
type : 'checkbox',
ref : 'confirmationButton',
text : 'Show confirmation dialog',
checked : false
},
{
type : 'checkbox',
text : 'Show grip icon',
checked : true,
onAction() {
grid.features.rowReorder.showGrip = this.checked;
}
}
],
data : DataGenerator.generateData(50)
});
const button = new Button({
appendTo : 'container',
text: 'click here',
onClick()
{
grid.hidden = !grid. Hidden;
}
});
Hey henrique,
Which version are you using?? I tested in the last version and didn't get that console.log (attached a video to show that)
Best regards,
Márcio