20 abstract public function addField($field,$key=
null);
21 abstract public function insertField($index,$field,$key=
null);
23 abstract public function fieldAs($index,$type,$attributes=NULL);
25 abstract protected function _fieldAs($elementCallback,&$index,$attributes=NULL,$prefix=
null);
34 return $this->
getCallable(
"getFieldButton",[$caption,$visibleHover],$callback);
43 private function getCallable($thisCallback,$parameters,$callback=
null){
44 $result=
function($instance) use($thisCallback,$parameters,$callback){
45 $object=call_user_func_array(array($this,$thisCallback), $parameters);
47 if(\is_callable($callback)){
48 $callback($object,$instance,$this->_instanceViewer->count()+1);
52 $id=$this->_instanceViewer->getIdentifier();
53 $object->setProperty(
"data-ajax",$id);
54 if($object->propertyContains(
"class",
"visibleover")){
55 $this->_visibleHover=
true;
56 $object->setProperty(
"style",
"visibility:hidden;");
69 $id=$this->_instanceViewer->getIdentifier();
92 public function fieldAsSubmit($index,$cssStyle=NULL,$url=NULL,$responseElement=NULL,$attributes=NULL){
93 return $this->
_fieldAs(
function($id,$name,$value,$caption) use ($url,$responseElement,$cssStyle,$attributes){
95 $button->postOnClick($url,
"$(event.target).closest('tr').find(':input').serialize()",$responseElement,$attributes[
"ajax"]);
96 if(!isset($attributes[
"visibleHover"]) || $attributes[
"visibleHover"])
99 }, $index,$attributes);
103 $this->_visibleHover=
true;
104 return $element->
addToProperty(
"class",
"visibleover")->setProperty(
"style",
"visibility:hidden;");
155 public function addDefaultButton($icon,$class=
null,$visibleHover=
true,$callback=
null,$key=
null){
156 $this->
addField($this->
getCallable(
"getDefaultButton",[$icon,$class,$visibleHover],$callback),$key);
169 $bt->addClass($class);
180 public function addDeleteButton($visibleHover=
true,$deleteBehavior=[],$callback=
null){
181 $this->_deleteBehavior=$deleteBehavior;
182 return $this->
addDefaultButton(
"remove",
"_delete red basic",$visibleHover,$callback,
"delete");
192 public function addEditButton($visibleHover=
true,$editBehavior=[],$callback=
null){
193 $this->_editBehavior=$editBehavior;
194 return $this->
addDefaultButton(
"edit",
"_edit basic",$visibleHover,$callback,
"edit");
205 $this->_displayBehavior=$displayBehavior;
206 return $this->
addDefaultButton(
"eye",
"_display basic",$visibleHover,$callback,
"display");
219 $index=$this->_instanceViewer->visiblePropertiesCount()-1;
233 public function addAllButtons($visibleHover=
true,$behavior=[],$callbackDisplay=
null,$callbackEdit=
null,$callbackDelete=
null){
235 $index=$this->_instanceViewer->visiblePropertiesCount()-1;
236 $this->_buttonsColumn=$index;
243 $this->_deleteBehavior=$deleteBehavior;
244 return $this->
insertDefaultButtonIn($index,
"remove",
"_delete red basic",$visibleHover,$callback,
"delete");
248 $this->_editBehavior=$editBehavior;
253 $this->_displayBehavior=$displayBehavior;
254 return $this->
insertDefaultButtonIn($index,
"eye",
"_display basic",$visibleHover,$callback,
"display");
BaseHtml for HTML components.
addToProperty($name, $value, $separator=" ")
Base class for Semantic double elements.