16 parent::__construct(
"search-" .
$identifier,
"div",
"ui search", array ());
20 $this->_params[
"type"]=
"standard";
25 if (isset($placeholder))
26 $field->setPlaceholder($placeholder);
28 $field->addIcon($icon, Direction::RIGHT);
29 $field->getDataField()->setClass(
"prompt");
30 $this->content[
"field"]=$field;
35 $this->content[
"result"]=
new HtmlSemDoubleElement(
"results-" . $this->identifier,
"div",
"results");
36 return $this->content[
"result"];
41 $this->_elements[]=$object;
47 $this->_elements=\array_merge($this->_elements, $objects);
52 $this->_params[
"apiSettings"]=
"%{url: %quote%" . $url .
"%quote%}%";
57 $this->_params[
"type"]=$type;
62 return $this->_params[
"type"];
66 $result=\json_encode($this->_elements);
75 $this->_params[
"onSelect"]=
'%function(result,response){$(%quote%#' . $this->identifier .
'%quote%).trigger(%quote%onSelect%quote%, {%quote%result%quote%: result, %quote%response%quote%:response} );}%';
76 $searchFields=\json_encode($this->_searchFields);
77 $searchFields=str_ireplace(
"\"",
"%quote%", $searchFields);
78 $this->_params[
"searchFields"]=
"%" . $searchFields .
"%";
79 if ($this->_local ===
true) {
80 $this->_params[
"source"]=
"%content%";
83 if (isset($this->_bsComponent) ===
false) {
84 $this->_bsComponent=$js->
semantic()->search(
"#" . $this->identifier, $this->_params);
95 $this->
addEvent(
"onSelect", $jsCode);
98 private function _opOnSelect($operation, $url, $responseElement=
"", $parameters=array()) {
99 return $this->
_ajaxOn($operation,
"onSelect", $url, $responseElement, $parameters);
102 public function getOnSelect($url, $responseElement=
"", $parameters=array()) {
103 $parameters[
"params"]=
"data.result";
104 return $this->
_opOnSelect(
"get", $url, $responseElement, $parameters);
107 public function postOnSelect($url, $responseElement=
"", $parameters=array()) {
108 $parameters[
"params"]=
"data.result";
109 return $this->
_opOnSelect(
"post", $url, $responseElement, $parameters);
semantic(Semantic $semantic=NULL)
getter or setter of the Semantic-UI variable
addEvent($event, $jsCode, $stopPropagation=false, $preventDefault=false)
addEventsOnRun(JsUtils $js=NULL)
_ajaxOn($operation, $event, $url, $responseElement="", $parameters=array())
Base class for Semantic double elements.
addToProperty($name, $value, $separator=" ")
run(JsUtils $js)
{{SimpleExtComponent\Ajax\common\html\BaseHtmlrun()\Ajax\common\html\BaseHtmlrun()}HtmlDoubleElement:...
__construct($identifier, $placeholder=NULL, $icon=NULL)
postOnSelect($url, $responseElement="", $parameters=array())
getOnSelect($url, $responseElement="", $parameters=array())
createField($placeholder=NULL, $icon=NULL)
_opOnSelect($operation, $url, $responseElement="", $parameters=array())