I have tried to get $(“#combo_project_list_body”).jqxDropDownList(‘getItems’);
But it retrieved values [object Object],[object Object],[object Object]
I want to get Item count and values in a array.
Below is my codes. php wokes fine and gets data into dropdown list.
$(“#testbtn”).on(“click”, function(){
var project_list = $(“#combo_project_list_body”).jqxDropDownList(‘getItems’);
alert(project_list);
});
I have three records in database;
this is my jquery;
$(document).ready(function () {
var theme = “”;
var url = “../jquery/php/combo_project_list.php”;
// prepare the data
var source =
{
datatype: “json”,
datafields: [
{ name: ‘p_no’ },
{ name: ‘p_name’},
{ name: ‘client_id’},
{ name: ‘reg_date’},
{ name: ‘end_date’}
],
url: url,
async: false
};
var dataAdapter = new $.jqx.dataAdapter(source);
// Create a jqxDropDownList
$(“#combo_project_list_head”).jqxDropDownList({
selectedIndex: 0, source: dataAdapter, displayMember: “p_no”, valueMember: “p_no”, width: 100, height: 18, theme: theme
});
$(“#combo_project_list_head”).jqxDropDownList({ autoDropDownHeight: true });
});
and PHP as below;
Thank You,
Supun Silva