Hello to all,
when we define the filter in datagrid we also have to define the value will be present in a combobox filter
$('#laboratory_result').datagrid({remoteFilter:true});
$('#laboratory_result').datagrid('enableFilter',[
{
field:'type_of_result',
type:'combobox',
options:{
panelHeight:'auto',
data:[ {value:'',text:'All'},
{value:'Check positive control - Matching passed',text:'Check positive control - Matching passed'},
{value:'Check positive control - Matching failed',text:'Check positive control - Matching failed'},
{value:'Get genotype data',text:'Get genotype data'},
{value:'Sample ID not found',text:'Sample ID not found'},
{value:'UNDETERMINED/OMITTED',text:'UNDETERMINED/OMITTED'}
],
onChange:function(value){
if (value == ''){
$('#laboratory_result').datagrid('removeFilterRule');
} else {
$('#laboratory_result').datagrid('addFilterRule', {
field: 'type_of_result',
op: 'equal',
value: value
});
}
$('#laboratory_result').datagrid('doFilter');
}
}
},
{
field:'sample_number',
type:'text',
options:{precision:1},
op:['equal','beginwith']
},
{
field:'genotype_old',
type:'text',
options:{precision:1},
op:['equal','beginwith']
},
{
field:'genotype',
type:'text',
options:{precision:1},
op:['equal','beginwith']
}
]);
When we set the values for a combobox filter the problem is how to implement a function that retrive all element for the combobox
At the moment I created a php script that return to me a json string with the grouped values
The question is easy: how can I integrate all?
who can help me?