diff options
Diffstat (limited to 'codebase/Dhtmlx/Connector/Data/ComboDataItem.php')
-rw-r--r-- | codebase/Dhtmlx/Connector/Data/ComboDataItem.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/codebase/Dhtmlx/Connector/Data/ComboDataItem.php b/codebase/Dhtmlx/Connector/Data/ComboDataItem.php new file mode 100644 index 0000000..4e65676 --- /dev/null +++ b/codebase/Dhtmlx/Connector/Data/ComboDataItem.php @@ -0,0 +1,32 @@ +<?php +namespace Dhtmlx\Connector\Data; + +/*! DataItem class for Combo component +**/ +class ComboDataItem extends DataItem{ + private $selected;//!< flag of selected option + + function __construct($data,$config,$index){ + parent::__construct($data,$config,$index); + + $this->selected=false; + } + /*! mark option as selected + */ + function select(){ + $this->selected=true; + } + /*! return self as XML string, starting part + */ + function to_xml_start(){ + if ($this->skip) return ""; + + return "<option ".($this->selected?"selected='true'":"")."value='".$this->xmlentities($this->get_id())."'><![CDATA[".$this->data[$this->config->text[0]["name"]]."]]>"; + } + /*! return self as XML string, ending part + */ + function to_xml_end(){ + if ($this->skip) return ""; + return "</option>"; + } +}
\ No newline at end of file |