ActiveContent in custom list

edited July 2016 in Technical questions

how can I get config.$masterId when clicking common.editButton, if I have templateStart and templateEnd options in type section?
here is the code:

type   : {
    templateStart: <div class="some_class"><div></div>,
template: function(obj, common){
   return "<div>" + + "</div>" + "<div style='float:right;'>"+ common.editButton(obj, common) +"</div>"
        id    : "editButtonId",
        view  : "button",
        type  : "iconButton", 
        icon  : "pencil",
        width : 30,
        click: function (id, e){

So, in console.log I get 'null', but when I comment the type section it works correctly.


  • It's not mentioned in the docs (we'll fix it), but items are detected by the webix_l_id attribute. Therefore, templateStart should always include the following notation:

    templateStart:"<div webix_l_id='#id#'>",

    Please check the snippet:

  • This works great. Thank you for your help

  • Hello, webix team. Is there an actual way to create custom elements of the list? Let's suppose that some elements need to add a button (according to some conditions).

  • edited September 2019

    Hey @lBeJIuk, you can create custom elements via HTML and return them in the template (where you can also check for some certain conditions).

    As an example, here is a ui.button inside of the list template: In the case of a list this won't really work however, as the component is designed to take up the full width of the parent, meaning there won't be enough space for anything else in the template (it would work just fine with a datatable though -

    That's why here you'll have to use a standart HTML button: Please note that this is a very rough example of what you can do in this situation.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!