Push data in subview datatable

edited March 17 in Technical questions

Hello, I have a datatable and each row contains another datatable inside a subview. How can i push data in datatable's subview ?

Comments

  • Hello, @Naufil

    According to the Documentation, there are several ways of filling subview. The way depends on the data you load.
    Please, check the link above, there are several examples in the text of the article.
    If you have a particular issue, could you, please, specify it?

  • Hi @AlenaLisava, basically I have a main datatable and with every datatable row i have another datatable using subview. in subview datatable i have a add data button which basically open popup form. when i submit on button i want to append data in subview datatable.

  • Hello, @Naufil

    To have the opportunity to add a new item to datatable via form, this form and datatable should be bonded.
    The simplest way to perform that is by using bind() method
    Since creating a separate popup with a form for each subview is redundant, you can reuse the same one by updating the bound table for the form when the window is opened (i.e. by clicking on the button).
    Please, pay attention, in order to use the same popup for all subviews, use also unbind() method

    There is a possibility to set the logic of interactions between subview datatable and "Add" button in the Click property of button config.
    First, get the subview with

    const topSubView = this.getTopParentView();
    

    And then get subview datatable with

    const subTable = topSubView.queryView("datatable");
    

    Here is an example: https://snippet.webix.com/cja7s8x3

  • Hi @AlenaLisava, I have done from another way but this approach also look good, will reuse in future. Thank you for the solution.

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!