QComboBoxの選択肢の文字は、HTMLタグを使って装飾することができます。
文字を装飾するには、QComboBoxの項目(qx.ui.form.ListItem)のsetRichメソッドに引数trueを渡します。
var children = QComboBox1.getChildren();
for (var i = 0; i < children.length; i++) { //qx.ui.form.ListItem
children[i].setRich(true);
}
■サンプルプログラム
//フォームのOnShowイベント
function Unit1Show($sender, $params)
{
$this->QComboBox1->writeItems(array(
'<font color="#FF0000">RadPHP XE</font>', //HTMLタグで装飾
'<i>Delphi XE</i>',
'<b>C++Builder XE</b>'));
}
//フォームのJavaScriptのOnLoadイベント
function Unit1JSLoad($sender, $params)
{
?>
//begin js
var children = QComboBox1.getChildren();
for (var i = 0; i < children.length; i++) {
children[i].setRich(true);
}
//end
<?php
}
※RPCLはRevision 291を使用しました。
参考:RPCL(RadPHP Component Library) の最新版について
![]() 【送料無料】PHPで初めてドラッグ&ドロップ開発を実現した革新的なWeb開発環境RadPHP XE ESD … |