所以我在php中有一个dhtmlxgrid,它完全由Firebird odbc中的sql填充。首先,我无法应付一排排的高度
第二,我认为这对我来说已经足够了,如果我在每个单元格中放入一行新行,我发现如果我将sql中的数据连接起来,然后再进行连接会更容易
我尝试了concat(), concat_ws(), +, ||
等的所有版本…
我也使用''n'
。
我有一个index.php,它只是加载网格。在这里只能做sg关于这个:`
<?php
$xml = 'connector.php';
echo '
<div id="gridbox" ></div>
<script>
doOnLoad("gridbox","'.$xml.'","0")
{ gridbox.enableAutoHeight(true);
gridbox.enableAutoWidth(true);
gridbox.setAwaitedRowHeight(250);
};
</script>
';
?>
`这会调用connector.php来加载数据并创建行,如:
$xml = new SimpleXMLElement('<rows >
<head>
<column width="150" type="ro" align="left" sort="str" >xy</column >
<afterInit>
<call command="attachHeader">
<param>#text_filter,</param>
</call>
</afterInit>
</head>
</rows>');
而写入数据的sql是:
$sql = "
select distinct
supexport.partner,
from supexport
where
";
这部分代码是将数据写入行中:
while ($row = $db_supexport->ReturnRow()) {
$currSor = $xml->addChild('row');
$currSor->addChild('cell',$row[0]);
}
(我剪切代码只是为了简化它:))
对于'
的特殊字符,必须使用双引号"
才能产生效果。此外,php中的串联是用句点.
完成的。
$string . "'n";