Our state of the art Gantt chart


Post by vivianus »

I have some questions:

       selectionMode: {
            checkbox: true,
            showCheckAll: false,
            rowCheckboxSelection: true
        },

1、The data is a tree structure, and the function I need is that the parent-child multiple check box has linkage effect:
check all the child check boxes, the parent's automatic check box, and check the parent, all the child's automatic check box.Is there a corresponding attribute?

2、And how to prohibit some multiple choice boxes?

3、When I check some children, then I shrink the parent. When I expand the parent again, the child's check status is lost,I want to save the status.


Post by mats »

  1. We have a ticket open to implement this: https://github.com/bryntum/support/issues/1951

  2. Can you please explain a bit more about the scenario?

  3. This is bug, we'll fix it: https://github.com/bryntum/support/issues/2795


Post by vivianus »

1.I tried your code, first check a parent, all of its children are selected, but when I deselect a child, I need to remove the parent check status. At this time, It enter the onselectionchange event again. Precisely because of this code,all my children are removed from the selected status:

	selectionchange: event => {
                const {selected, source, deselected} = event
                console.log(event)
                if (selected.length === 1) {
                    if (selected[0].isLeaf) {
                    } else {
                        selected[0].children.forEach(record => {
                            source.selectRow({record, addToSelection: true})
                        })
                    }
                }
                if (deselected.length === 1) {
                    if (deselected[0].isLeaf) {
                        source.deselectRow(deselected[0].parent)
                    } else {
                        deselected[0].children.forEach(record => {
                            source.deselectRow(record)
                        })
                    }
                }
            }
  

My requirement is that if all the children are checked, the parent will check automatically. If all the parents and children are checked before, when I cancel a child again, the parent should remove the selected or semi selected status

Because it can only be written in the selectionchange method that the parent-child linkage is checked and cancelled, and the selectionchange method will be executed multiple times, resulting in my method conflict and unable to realize the function

2.It means that I want to ban a multiple-choice box


Post by mats »

1.I tried your code,

Which code?

You can download the latest nightly build and get the code with the fixes for the tickets mentioned above


Post Reply