data

sets the data source for inner multiselect list

array| function data;

Example

webix.ui({
  view: "query",
  data: [
    {
      id: 1,
      last_name: "Gaylord",
      first_name: "Nedra",
      birthdate: new Date("1983-04-22 00:00:00"),
      country: "Madagascar"
    },
    // other objects
  ]
});

Related samples

Details

When Query is used for filtering some Webix data widget, e.g. Datatable, their data sources must coincide. Within Query this data will be parsed into a Filter multiselect list to form filtering options.

// both widgets (Query and Datatable) will refer to this source
const data_collection = [/* large dataset */];
 
webix.ui({
  cols: [
    {
      view: "query",
      data: data_collection, 
      // ...
    },
    {
      view: "datatable",
      data: data_collection,
      // ...
    }
  ];
});

If used as a function data returns promise that resolves with an array of options.

{
  view: "query",
  data: field =>
    webix.ajax(`http://localhost:3200/api/data/persons/${field}/suggest`)
     .then(a => a.json())
}

The function is called for each field when editing begins.

Back to top