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?
maksim
April 29, 2015, 3:24pm
2
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
maksim
April 30, 2015, 11:52am
4
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 )