send DataCollection to window

Hi,
I have a datagrid, I need to open a new window on doubleclick to a row.

In this moment I have bound the window to the datagrid
$$("FlightDetailsView").bind($$("flightsGrid"));
This actually works fine.

But I need to send other data to the window, how can I do?

My final goal is to open a window and then (with a button on the window), pass to the next record.

I think that the best solution is to send the whole datacollection to the window?

Any ideas?

Dunno if it’s the coorect solution but…
I’ve created a function inside the window component: getData(collection)

In the main view (where is the datatable), I call the getdata after the onShow event of the window, sending the collection to the window view:

export default class FlightDetailsView extends JetView {
...
    config(){
        return {...}
    }

    getdata(item, datacollection){
        console.log(item, datacollection)
    }
}


export default class FlightsView JetView {
...
    config(){
        return {...}
    }

    init(){
        this.win = this.ui({
              view:"window",
              position:"center",
              head:"Window",
              close: true,
              modal: true,
              body: FlightDetailsView
            });
    }

    ready() {
       // have to wait the render of the grid beacuse otherwise it raises an error

        $$("flightsGrid").attachEvent("onAfterRender", function(){
           $$("FlightDetailsView").bind($$("flightsGrid"));
        });

        this.win.attachEvent('onShow', ()=>{
          console.log(this.getGrid());
          let item = this.getGrid().getSelectedItem();
          $$("FlightDetailsView").$scope.getData(item, this.getGrid().data);
        });

        //... other code to handle the show of the window

    }

    
}

If someone wants to check the code, any advice is welcome :slight_smile: :slight_smile:

Much more clever …
this.win = this.ui(new FlightDetailsView(this.app,"win_name", item, this.getGrid().data))

from this topic: https://forum.webix.com/discussion/35557/how-to-pass-initialization-parameters-to-views-created-with-this-ui