EasyUI Forum

General Category => General Discussion => Topic started by: hahamed on September 14, 2016, 12:04:22 AM



Title: Combobox method to get record?
Post by: hahamed on September 14, 2016, 12:04:22 AM
Hello
I want to get record of selected item with method.
The record is a json object of item.
How? thanks


Title: Re: Combobox method to get record?
Post by: jarry on September 14, 2016, 07:27:05 PM
Please try this code:
Code:
var cc = $('#cc');
var value = cc.combobox('getValue');
var item = $.grep(cc.combobox('getData'), function(row){
if (row.value == value){
return true;
} else {
return false;
}
});
console.log(item);