I have in table columns name and rc. I retrieve values by select in php by js code info array.
I want to display this values in html table with other values by javascript.
My question: Whats way to join values name and rc in js? I need to join values and split them by CRLF and display them in one tag <td>.But in js.
$sql = "select rc, meno from jqcalendar where sala_typ='$sala_typ' and left(StartTime,10) ='$datumvykonu'";
$handle = mysql_query($sql);
$retArray = array();
while ($row = mysql_fetch_row($handle)) {
$retArray[] = $row;
}
$data = json_encode($retArray);
$ret = "{data:" . $data .",\n";
$ret .= "recordType : 'array'}";
echo $ret;
-- other php page ---
<script type="text/javascript" >
var grid_demo_id = "myGrid1" ;
var dsOption=
{
fields :
[
{name : 'rc' },
{name : 'meno' }
],
recordType : 'array'
}
var colsOption =
[
{id: 'rc' , header: "Rod.cislo" , width :80 },
{id: 'meno' , header: "Meno" , width :100 }
];
</script>
Thanks.