HI in my db im having table students with student number and student name and facility.
from this db table students
in dhtmlxgrid in acolumn im having 2 cells,first cell should contain student number and second cell is combobox which contains student name of given student number in first cell
if i enter first cell data with student number the folowing student name should appear in second cell.
i have loaded student name in the combobox(i.e cell2)
file name:ta_student_combo.php(code for combo box in cell2)
[code]<?php
include(“includes/ta_connect.php”);
$fac_id=$_POST[‘fac_id’];
$student=“select student_no,first_name from tbla_student_details where facility_id=$fac_id order by first_name”;
$rs=$conn->Execute($student);
$b="";
while(!$rs->EOF)
{
if($b=="")
$b=$rs->fields[0]."~".$rs->fields[1];
else
$b.="#".$rs->fields[0]."~".$rs->fields[1];
$rs->MoveNext();
}
echo $b;
?>
in the grid i have loaded combobox data as.
function doInitGrid()
{
var fac_id=$("#cbo_fac_id").val();
$.ajax({
async:true,
type:“POST”,
data:“fac_id=”+fac_id,
url:“ta_student_combo.php”,
success:function(msg)
{
if(msg!=’’)
{
var student=msg.split("#");
for(var i=0;i<student.length;i++)
{
var arr=student[i].split("~");
mygrid.getCombo(1).put(arr[0],arr[1]);
}
}
}
});
}[/code]
now when i enter student number(cell1) corresponding student name should appear in combobox(cell2)
please suggest me how to do this.
Regards
narinas.