Multiviews and ids

What is the best practice for working with multiviews and ids? In Webix Jet there’s an option to add localId but I don’t see that option in Webix. I’m using a multiview with multiple forms and lists. I use the ID to find certain fields. At the moment I prefix the fields… but this become tedious and error prone… :frowning:

you can define innerId (not only, but also any other preferred) to view and use queryView to get that view
https://docs.webix.com/api__link__ui.view_queryview.html

{
    view: "button",
    innerId: "testid"
}
var somechildview = parentView.queryView({innerId:"testid"});//first found
var allchildviews = parentView.queryView({innerId:"testid"}, "all"); //all found
var parent = childView.queryView({innerId:"testid"}, "parent");//first parent

also you can try to use isolate mode for layout
https://docs.webix.com/api__ui.layout_isolate_config.html

Hey @zevenbergm,
Honestly, I can speak for myself only, but I do believe that naming those ids properly will alleviate most of your frustrations. Since in standart Webix UI we can only use global IDs, you can think of a clever naming scheme that would reduce the risk of repeating yourself to almost zero. For example, let’s imagine we have a section of our app that is responsible for storing and editing settings, in this case, you could name your ids inside that view settings:id. As far as I know, there’s really no other way than just simply naming your ids in a clever way. Alternatively, as you mentioned, you could just use Webix Jet if your app is getting complex, as this is exactly the reason why it was build in the first place.

Thanks @integral and @Dzmitry! I’ll try the isolate option first since this perfectly fits my needs! Many thanks for the prompt reply! Much appreciated!

In Webix Jet there’s an option to add localId but I don’t see that option in Webix

You can add ANY custom attribute for the view

{ view:"list", myId:123 }

and later locate this view by usin

var list = top.queryView({ myId: 123 });

https://docs.webix.com/api__link__ui.view_queryview.html

WebixJet uses the same API for localId/this.$$