bug report: datatable subview is not destroyed when remove datatable view

Hi
I have a datatable subview with inside some fields (combo, text ecc) with fixed id, because the fields must interact with each other (for example I have combos that depend on what has been selected in other previous combos)
when I remove the datatable and then add it again, the system fails as a result of duplicate id fields

workaround

webix.attachEvent("onDataTable", function (table, config) {
        table.eachColumn(id => {
            var col = table.getColumnConfig(id);
            if (col.suggest && typeof col.suggest == "object") {
                col.$destroySuggest = true
            }
        })
        table.attachEvent("onDestruct", function () {
            table.eachColumn(id => {
                var col = table.getColumnConfig(id);
                if (col.$destroySuggest) {
                    var suggest = $$(col.suggest);
                    suggest && suggest.destructor();
                }
            })
            table.config.subview && table.eachRow(row => {
                var subView = table.getSubView(row)
                subView && subView.destructor()
            })
        })
})

suggests as object are not destructed as well.
so there is a workaround for them too.

thanks

Hello,

I can confirm the issue. We will fix it in the next version 6.2
Thank you for the report!

@davideS4bt Could you please check the following info?

a datatable subview with inside some fields (combo, text ecc) with fixed id

In such config the system will show the “non unique id” error already when any subsequent subview is opened, because the same configuration is used. So you needn’t destroy anything.

Try this snippet locally with the debug version and open several subviews to see the error: Code Snippet

So while we can fix a bug with datatable destruction and subviews (and we will), fixed ids in subview configuration are not correct. If you still need to tune some interaction between sub elements, you should do it on subview creation with queryView method:

onSubViewCreate:function(view, item){
   view.setValues(item);
   view.queryView({name:"title"}).attachEvent("onTimedKeyPress", function(){
     webix.message(this.getInputNode().value);
   });
 }

https://snippet.webix.com/5m5fmlkr

Hello!
Good news! We fixed the bug.
The fix is already available in Webix 6.1.2 Pro.
In GPL version the fix will appear in 6.2.

Hi thanks, but I have find the same bug when I remove a row and then add a new row.
Also this bug is fixed?

Hello,

Again, thanks for reporting. The nearest minor version will include this bug fix as well.

Hi, I dont test the Webix 6.1.2 Pro but the workaround generates errors in internet explorer 11