本文整理汇总了PHP中TEntry::setProperty方法的典型用法代码示例。如果您正苦于以下问题:PHP TEntry::setProperty方法的具体用法?PHP TEntry::setProperty怎么用?PHP TEntry::setProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TEntry
的用法示例。
在下文中一共展示了TEntry::setProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
/**
* Shows the widget
*/
public function show()
{
$tag = new TEntry($this->name);
$tag->setEditable(FALSE);
$tag->setProperty('id', $this->name);
$tag->setSize(40);
$tag->setProperty('onchange', "aux = document.getElementsByName('{$this->text_name}'); aux[0].value = this.value;");
$tag->show();
// define the tag properties
$this->tag->name = $this->text_name;
$this->tag->onchange = "entry = document.getElementById('{$this->name}'); entry.value = this.value;";
$this->tag->style = "width:{$this->size}px;";
// tamanho em pixels
// creates an empty <option> tag
$option = new TElement('option');
$option->add('');
$option->value = '0';
// valor da TAG
// add the option tag to the combo
$this->tag->add($option);
if ($this->items) {
// iterate the combobox items
foreach ($this->items as $chave => $item) {
// creates an <option> tag
$option = new TElement('option');
$option->value = $chave;
// define the index
$option->add($item);
// add the item label
// verify if this option is selected
if ($chave == $this->value) {
// mark as selected
$option->selected = 1;
}
// add the option to the combo
$this->tag->add($option);
}
}
// verify whether the widget is editable
if (!parent::getEditable()) {
// make the widget read-only
$this->tag->readonly = "1";
$this->tag->{'class'} = 'tfield_disabled';
// CSS
}
// shows the combobox
$this->tag->show();
}