function BindDropDown2($dropdownName, $tableName, $keyField, $valueField) { $obj = new DROPDOWN(); $obj->datasource = PdoDataAccess::runquery("select * from " . $tableName); $obj->valuefield = "%" . $keyField . "%"; $obj->textfield = "%" . $valueField . "%"; $obj->Style = 'style=\'width:98%\' class=\'x-form-text\''; $obj->id = $dropdownName; $obj->datasource = array_merge(array(array($keyField => "-1", $valueField => "---")), $obj->datasource); return $obj->bind_dropdown(); }
static function DRP_LevelType($dropName, $selectedId = "", $extraRow = "", $width = "90%") { require_once inc_component; $obj = new DROPDOWN(); $obj->datasource = parent::runquery("select * from Basic_Info where TypeID=26"); $obj->valuefield = "%InfoID%"; $obj->textfield = "%Title%"; $obj->Style = 'class="x-form-text x-form-field" style="width:' . $width . '"'; $obj->id = $dropName; if (!empty($extraRow)) { $obj->datasource = array_merge(array(array("InfoID" => "-1", "Title" => $extraRow)), $obj->datasource); } return $obj->bind_dropdown($selectedId); }
public static function DRP_DependentSupportStatus($dropdownName, $selectedID = "", $style = "") { $query = "select * from Basic_Info where TypeID = 31"; $obj = new DROPDOWN(); $temp = PdoDataAccess::runquery($query); $obj->datasource = $temp; $obj->valuefield = "%InfoID%"; $obj->textfield = "%Title%"; $obj->Style = 'class="x-form-text x-form-field" style="' . $style . '"'; $obj->id = $dropdownName; return $obj->bind_dropdown($selectedID); }
function bind_dropdown($selectedID = "") { $return = "<div id='ext_" . $this->id . "'/><script>\r\n\t\t\tnew Ext.form.ComboBox({\r\n\t\t\ttypeAhead: true,\r\n\t\t\tmode: 'local',\r\n\t\t\thiddenName: '{$this->id}',\r\n\t\t\trenderTo : 'ext_" . $this->id . "',\r\n \ttriggerAction: 'all',\r\n store: new Ext.data.SimpleStore({\r\n\t\t\t\tfields: ['" . implode("','", array_keys($this->datasource[0])) . "'],\r\n\t\t\t\tdata : " . parent::PHPArray_to_JSSimpleArray($this->datasource) . "\r\n\t\t\t}),\r\n\t\t\tvalue : '" . $selectedID . "',\r\n\t\t\tdisplayField : '" . str_replace("%", "", $this->textfield) . "',\r\n\t\t\tvalueField : '" . str_replace("%", "", $this->valuefield) . "',"; $return .= $this->width != "" ? "width: '" . $this->width . "', minListWidth: '" . $this->width . "'," : ""; $return .= "forceSelection:true\r\n\t\t});</script>"; return $return; }