How do I get a list item ID not by an index, but by it's actual data item object?

e.g. if i have a webix widget:

webix.ui({
	view: 'list',
	id: 'myList',
	container: 'myListContainer',
	template: '#text#',
	select: 'multiselect',
	autoheight: true,
	navigation: true,
	data: [
		{text:'foo'},
		{text:'bar'},
		{text:'baz'},
		{text:'qux'},
	],
})

i can get an ID by an index

var l=$$('myList'), d=l.data
var id = d.getIdByIndex(2) // <--- HERE
d.getItem(id) //=> {id:1428492928744, text:"baz"}

but I want to get an ID by an actual data item object, e.g.:

var id = d.id({text:'baz'}) // or something similar

here’s an example JSBin: JS Bin - Collaborative JavaScript Debugging

well, i found a solution using Lodash:

var id = _(d.serialize()).find({text:'baz'}).id

but i’m not sure if .serialize() is still the way to go

DataTable has .find method, but there is no alternative for other components.

You can use each iterator to locate item as follows

var id;
d.data.each(function(item){
    if (item.text == "baz") id=item.id;
});

ok, thanks!