input id in custom component

Hi all,
is there a way to set “<input id=” each new instance different on custom component?

I have seen many examples with ‘x’+webix.uid() but I’m not able to reply the behaviour.

Thank you.

I think that you use a cached copy of generated string. Otherwise it must return a unique instance on each call.

Yes, but I wrote

    $renderInput: function(config, html, id) {
        id = 'x'+webix.uid();
        return webix.ui.text.prototype.$renderInput.call(this, config, html, id);
    },

which I suppose it should change every new instance of component.

I’m using the component as active component into a datatable column

you must not change proposed id. why are you trying to do it?

I have a datatable view with many rows and only one column to be edited.
I do not want use webix built-in editor but a simple “text” view with special features repeated for each row.
So I have created a component as active content in the datatable view and declared it for the editable column

activeContent: { QTA: { view: “numeric_entry”, width: 50 } }

{ “header”: " ", “template”: “{common.QTA()}”, }

Everthing works fine, I have as many edit box as the rows in datatable, the only thing I need is the “input id=…” node different for each one.

yes, you have as many edit box as the rows, but actually all of them are kind of fake. try to console.log generated id. you should have multiple ids if there are multiple instances of QTA

I see, but I was inspired by the following snippet
http://webix.com/snippet/99133930
(from which one I took the tip) where the counter edit box input id are different from each other, the only difference is that counter is a webix widget therefore I am missing something in my protoui

given snippet is misbehaved. try to walk between rows clicking on counter’s body. after few switching counter will take previous focused row’s value.

As @integral said, activeContent duplicates the same object including the ID. Unfortunately, the issue in the above snippet is a known bug with the activeContent and enabled selection.

Ok. I will change my mind to find different approach

As a workaround, it’s possible to prevent selection when clicking the counter:

http://webix.com/snippet/ee9a92a9

When I finally decided to use counter as active content(it workerd very well), I discovered that when I click on + or - button, a new copy of counter is created and appended as child! If I click 100 times on + I will see new 100 div in dom! Is it a bug or is it a malfunctioning because my custom use?

Ok, I will use webix built-in editor

It’s an unexpected behavior. Could you please provide a snippet that will represent this issue?

yes, very strange behavior http://webix.com/snippet/ee9a92a9

Yep, I can confirm the Chrome-only bug.

I used a custom editor instead of all those stuff. Everything works like a charm! I should have used it from the beginning, it’s so flexible.