コード例 #1
0
ファイル: Select.php プロジェクト: tegansnyder/Logger
 /**
  * @return string
  */
 protected function _toHtml()
 {
     $htmlId = $this->getColumnName() . '#{_id}';
     $select = new Varien_Data_Form_Element_Select(array('html_id' => $htmlId, 'no_span' => TRUE, 'name' => $this->getInputName()));
     $select->addData($this->getColumn());
     $select->setForm(new Varien_Object());
     $select->setValues($this->getValues());
     // Escape properly and use javascript to set the selected values
     return str_replace(array("\n", '"', '/'), array('', '\\"', '\\/'), "\n    {$select->getElementHtml()}\n    <script type=\"text\\/javascript\">\n      \$(\"{$htmlId}\").setValue(\"#{{$this->getColumnName()}}\");\n    </script>\n    ");
 }