Best way to make custom editor?

Hello guys…

I made this simple table with unfinished custom editor on last column http://webix.com/snippet/f20374e5 . The custom editor is a simple text area which reset value before edited.

Why it’s say ‘script error’? the console said ‘this.getInputNode(…).setValue is not a function’. Is this a good way to make custom popup editor?

Thank you…

Hello,

by default, the popup editor can contain only one view. But you can create a custom editor that will take value from the first inner view (textarea):

http://webix.com/snippet/658f0c7e

Thank you for the answer,
But how to change the text area value? I tried to make a reset button here http://webix.com/snippet/a1008efe

Or is there any other better way to do it?

Try to use the setValue method:

http://webix.com/snippet/ca32dcee

Thank you for the answer, it works…

Hello again…

I notices some performance issue with this. In this snippet http://webix.com/snippet/8fe951f4 , I applied onBlur to the popup.

As you’ll see in the console, it’s ‘blur-ing’ a lot of popup after couple of open and hide pop up. In the my project, this cost a lot of resource. How to actually hide the popup after every edit?

Thank you…

Hi,

You are applying applyEvents from the getInputNode. As resutl attachEvent code is called multiple times, and you have many blur handlers instead of a single one.

Just move event handler into the editor’s config, so it will be initialized only one time per editor

http://webix.com/snippet/1c556bc6

Wow, thank you for the answer! that explain a lot, thnks!