Hello everyone,
i need help to solve my problem about combobox data (inline editing).
First, i'm sorry if i write bad english.
The case,
I have edatagrid (inline editing) like this :
<th field="pipeline_status" width="50" editor="{type:'combobox',options:{required:true,data:products,textField:'name',valueField:'productid'}}" formatter="status" align="left">Status</th>
I have some record from mysql table :
1. PROCESS
2. SOLISIT
3. DOCUMENT
4. NAP
5. etc
In the combobox, if the current value is SOLISIT, combobox data only show > 2 (Document, NAP, etc), and hide the value < 2 (Process).
There is no problem in mysql query, because i just limit query to get it.
I'm doing this script :
var products = <?php echo $status; ?> ; //mysql query limit 1,5
var products2 = <?php echo $status2; ?> ; // mysql query limit 2,5
function status(value){
if (value < 2){
for(var i=0; i<products.length; i++){
if (products[i].productid == value) return products[i].name;
}
return value;
}
else if (value >= 2){
for(var i=0; i<products2.length; i++){
if (products2[i].productid == value) return products2[i].name;
}
return value;
}
}
But, the combobox data show all of data, and i think because of default command (
data:products):
<th field="pipeline_status" width="50" editor="{type:'combobox',options:{required:true,data:products,textField:'name',valueField:'productid'}}" formatter="status" align="left">Status</th>
So, how can i solve this ? Can somebody help me? Sworthy, maybe?
Here i'm using CodeIgniter Framework.