EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: nijokjose on August 21, 2013, 11:09:50 AM



Title: combobox postback problem
Post by: nijokjose on August 21, 2013, 11:09:50 AM
Hi All,
I'm a designer, new to easyui and so excited to use it. I tried a dropdownlist in asp.net for combobox. But the 'SelectedIndexChanged' event doesn't work. I hope this isn't a big issue and someone will be there to guide me.

Thanks in advance.


Title: Re: combobox postback problem
Post by: stworthy on August 21, 2013, 05:26:23 PM
The combobox plugin is not a server side component. It has not SelectedIndexChanged event but onChange and onSelect events.
Code:
$('#cc').combobox({
  onChange:function(newValue, oldValue){
    //alert(newValue);
  },
  onSelect:function(row){
    alert(row)
  }
});


Title: Re: combobox postback problem
Post by: nijokjose on August 21, 2013, 10:34:15 PM
Thanks for the reply.

But, is it possible to call the server side function onChange or onSelect?


Title: Re: combobox postback problem
Post by: stworthy on August 22, 2013, 01:48:08 AM
It is easy to call server side function using $.ajax. Here is the simple example:
Code:
$.ajax({
type:'post',
url:'data.ashx',
contentType:'application/json;charset=utf-8',
dataType:'json',
success:function(result){
//...
}
});


Title: Re: combobox postback problem
Post by: nijokjose on August 23, 2013, 10:58:55 PM
Thanks a lot. It works fine.