template with parameters

how can I insert dynamic parameters in this instance:
view: "template", scroll:"y", src: "data/show_layout.php?idprogetto=" ?????,

the parameter I need is (id) which comes from here:
$$("Uploader").bind($$("list"), function(slave, master){
if (!master) return false;
return master.id == slave.id_progetto;


  • Hello @lucianotrinca,

    You can dynamically redefine the src property at any point during the code execution via the define() method. The end result would look something like this:

    $$("Uploader").bind($$("list"), function(slave, master){
      if (!master) return false;
        src:  "data/show_layout.php?idprogetto=${master.id}"
      return master.id == slave.id_progetto;

    Here is a small isolated example showcasing the dynamic property change: https://snippet.webix.com/v1fi2ts6.

  • thanks Dzmitry

  • Hi Dzmitry, I want to insert a svg element that functions as a button inside a template and when I click on it another element in the same template changes contents. example:
    var layout = {
    cols: [
    {template: "col 1"},
    {id: "a1", template: "column 1", width: 150},
    {view: "template", scroll: "y", template: "data / rectangles.svg", onClick: {"sx": function (e, id) {
    webix.message ("replace an image in template col 1");

      Thank you

  • Hello @lucianotrinca ,
    You can redefine template dynamically through:
    $$("t1").config.template = function(){...};
    Please check the following snippet:

  • great!! perfect thanks. I have to ask you another question.
    In column 1 I have two images sx_big and dx_big and in the third column on the right I have two images which are called sx and dx and each one must replace the corresponding one in the first column.
    After being replaced, the two images of the first column must allow with a drag and drop from an element of a list to associate their value (the original one of the image we dragged from the third column) with the value of the element of the list.
    for example: a list contains names and I want each name to be dynamically associated with the image of the first column.
    forgive the complexity of my question. if needed I can send you a diagram.
    thanks for your availability and patience.

  • edited February 6


    if needed I can send you a diagram.

    I’m afraid the description of the issue is not clear for me.
    Сould you please provide the diagram?

    Also you can use:
    1. DnD for list
    Usually for any tasks it’s enough to write the correct drag or drop handler, which will take into account/process all the parameters that have arrived.
    2. DnD for template
    If your pictures are located in separate templates, you can use the example (https://snippet.webix.com/20d24ef9) It show how drag and drop handlers can be set for each template.

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!