Our flexible Kanban board for managing tasks with drag drop


Post by licjapodaca »

I want to cancel the card added by "addTask" when I press the [Tab] key or just when focusOut the TextField ...

screenshoot 11.jpg
screenshoot 11.jpg (132.64 KiB) Viewed 1221 times

I already configure the "simpleTaskEdit" with the following code:

simpleTaskEdit: {
	disabled: false,
	addNewAtEnd: false,
	blurAction: 'cancel', // <=== I set it to 'cancel' to revert the change when TAB or lose the focus
	...
}

But with that configuration adds the Task as you can see:

screenshot.gif
screenshot.gif (586.47 KiB) Viewed 1221 times

Regards


Post by Maxim Gorkovsky »

Hello.
SimpleTaskEdit feature doesn't have a config called blurAction https://lh/bryntum-suite-release/taskboard/docs/#TaskBoard/feature/SimpleTaskEdit Where did you find it?

Also when editing is started, task is already added to the store. You can try to remove it in the listener. Problem is that simpleTaskEdit feature doesn't expose any public handles. I've opened a feature request to make it more customizable: https://github.com/bryntum/support/issues/3186

You can try to override editTask method of the feature to setup additional listener:

Override.apply(class {
  static get target() { return { class : SimpleTaskEdit } }

  editTask(record, element) {
    const result = super.editTask(record, element);
    this.editor.on({
      finishEdit() { record.remove() } // removes all edited records, put your condition here
    });
    return result;
  }
})

Post by licjapodaca »

My bad, I put the "bluAction" in a wrong place, I already move this property to the right place like so:

simpleTaskEdit: {
	...
	editorConfig: {
		...
		blurAction: 'cancel'
		...
	}
}

And now it works as I expected ... the card trigger the "cancel" event of the "Editor" and reverts the Task that I added.

The information about "blurAction" is under the "editorConfig" (Editor) in the following link:
https://bryntum.com/docs/taskboard/#TaskBoard/feature/SimpleTaskEdit#config-editorConfig

Regards


Post by johan.isaksson »

The ticket referenced above was closed as a duplicate, ticket to track instead: https://github.com/bryntum/support/issues/3156

Best regards,
Johan Isaksson

Post Reply