Our state of the art Gantt chart


Post by S.R. »

Hi,

I observed the following unexpected bahaviour:
A field - for example the start date field - is set to required.
The value of the start date is deleted within the start date column of a task.
The field is marked as invalid/required.
Now it's not possible to click or double click within another cell or somewhere else outside this cell (e.g. another cell or diagram or right click to open the task menu ...).

=> My expectation:
When clicking/double clicking somewhere the editing of the cell is canceled and the last valid the field value is reset to the last valid known value, i.e. the value before editing.

What can I do to reach this expected behaviour?
Catching the corresponding events (e.g. taskMenuShow, taskClick, cellClick, selectionChange etc.) and cancel editing on the Gantt is a bit painful ...

Thanks in advance for any hints.


Post by tasnim »

Hi,

It is happening because https://bryntum.com/products/gantt/docs/api/Gantt/feature/CellEdit#config-blurAction is set to complete and it can't complete since it's an invalid input so you'd need to press ESC key to do it manually.
So if you set the blurAction to cancel. It'll work the way you want it to.

features : {
	cellEdit : { blurAction : 'cancel' }
}

Best regards,
Tasnim


Post by S.R. »

Hi,

thanks for the hint. This works fine.

Does something similar exist for the task editor?
This means, reset to the last valid value when clicking in another field within the editor?

Thanks in advance!


Post by alex.l »

Hi, it is, but using Cancel button of the dialog.

All the best,
Alex


Post by S.R. »

Hi,
so there is no way to reset to last valid value just by clicking in another field?

Example:
Start date is required. I remove the current start date value and click into the finish date field.
=> My expectation: Start date is reset to last valid value.

Thanks.


Post by alex.l »

Hi,

It will reset value if you will change sensitive data. Otherwise it will store invalid value until you changed it to valid or cancel changes.
This is how it works. Another behaviour is possible but you'll need to implement it yourself. As example, subscribe on blur event and reset value.
Here is guide how to customize TaskEditor https://bryntum.com/products/gantt/docs/guide/Gantt/customization/taskedit
https://bryntum.com/products/gantt/docs/api/Gantt/widget/TaskEditor
Here is event docs https://bryntum.com/products/gantt/docs/api/SchedulerPro/widget/StartDateField#event-focusOut

All the best,
Alex


Post by S.R. »

Hi again,

I have the following problem:
Having set

cellEdit: {blurAction: 'cancel'} 

and startDateField set as required and moreover set the startDateColumn to instantUpdate: false.
This combination causes, that a value set in the column cell is not set on the task anymore.
Inline editing has no effect anymore.

Is that intended or just an invalid combination of config options?
If I set instantUpdate: false the set value in the column is set on the task.


Post by tasnim »

Hi,

As you have instantUpdate set to false it's not gonna update instantly. I'm a bit confused about the issue you're having, could you please rephrase the issue and would you be able to share a reproduction video of this issue?


Post by S.R. »

I have the following Gantt configuration:

columns:

{ type : 'startdate', 
  editor: new StartDateField({required: true}), 
  instantUpdate: false
},

features:

cellEdit: {
  blurAction: 'cancel'
}

My expectation:

  • Start date field in the start date column is mandatory.

  • If I remove the start date or enter an invalid value and click somewhere outside the cell, the last valid value is set.

  • If I set a valid value in the cell and click somewhere outside the cell, I expect that the set value is taken and not the one before.

Why I set this configuration:
In our scheduling methodology start and end date are required.
If the user deletes the date value or enters an invalid one, the value should be reset to the last valid one if he clicks somewhere outside the cell. Like this it is assured, that the fields contain a valid value.
To reach this we cancel editing as you advised in your post above.
For performance reasons we set instantUpdate to false.

According to my tests, this seems to be an invalid combination of config options, as it is now not possible anymore to set a value in the column cell.
See attached video and code snipped from your online advanced exmple for clarification.

Best regards.

Attachments
Bryntum Gantt - Advanced demo Code - cell-edit.js
(25.74 KiB) Downloaded 23 times
Bryntum Gantt - Advanced demo - Google Chrome - cell-edit.zip
(4.23 MiB) Downloaded 20 times

Post by S.R. »

Additional observation:
Due to

cellEdit: {
  blurAction: 'cancel'
}

it's not possible to change other fields like the name for example.


Post Reply