Hi,
We have a requirement to show the combo filter in a datagrid dynamic data which it loads from remote server.
I have written the below code, there are not errors but list is not loading.
Can anyone please help how to load remote options dynamically in the datagrid combo box.
dg.datagrid('enableFilter',[{
field:'personName',
type:'combobox',
valueField: 'id',
textField: 'name',
loader: listLoader,
mode: 'remote'
}
]);
var listLoader = function (){
var items = "";
$.ajax({
url: 'accTypesList.htm',
type:'POST',
cache:false,
success: function(data){
items = $.parseJSON(data, function(key,value){
return {
id: key,
name: value
};
});
}
});
return items;
}
[u]Response format example[/u]: {"1":"abc","2":"xyz","3":"asdf"}
Thanks in advance.