How to prevent adding new row with save function

In my form i defined onSubmit event.

                on: {
                    onSubmit: function(view, ev){
                        if(this.validate()){
                            this.save();
                        }
                    }
                }

But if there isn’t any selected row, it adds new row.
How to prevent this?

Which reaction do you need to have when saving a form without selection in the master grid?

If you don’t want to create a new record, probably, the best solution will be to hide or to disable the form when a master record is not selected.

I have 2 list, 1 datatable and 1 form for records in same page.

Users → Records → RecordItems | Record Form

If I select a user, it loads records. If I select record, it loads recorditems.

Also I can edit selected record from record form. But if don’t select anything, it adds new row and that fails when I save.

I’ve just simply added getSelectedId. I’m not sure that is there any good solution. I thought i can check it something like this.master.id

You can use onBindApply event

http://webix.com/snippet/a8fd04a9

In the above example, the datatable component will disable self when it is not bind to the specific record in the master ( you can use the same event to store the master id in some property of linked component )