Skip to content

Commit 6831dbd

Browse files
committed
DataTable 4 bug fixed
1 parent baf19ce commit 6831dbd

File tree

2 files changed

+25
-22
lines changed

2 files changed

+25
-22
lines changed

Ajax/semantic/widgets/datatable/DataTable.php

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -291,29 +291,7 @@ public function asForm(){
291291
return $this->getForm();
292292
}
293293

294-
/**
295-
* Creates a submit button at $index position
296-
* @param int $index
297-
* @param string $cssStyle
298-
* @param string $url
299-
* @param string $responseElement
300-
* @param array $attributes associative array (<b>ajax</b> key is for ajax post)
301-
* @return \Ajax\semantic\widgets\datatable\DataTable
302-
*/
303-
public function fieldAsSubmit($index,$cssStyle=NULL,$url=NULL,$responseElement=NULL,$attributes=NULL){
304-
return $this->_fieldAs(function($id,$name,$value,$caption) use ($url,$responseElement,$cssStyle,$index,$attributes){
305-
$button=new HtmlButton($id,$value,$cssStyle);
306-
$button->postOnClick($url,"$(event.target).closest('tr').find(':input').serialize()",$responseElement,$attributes["ajax"]);
307-
if(!isset($attributes["visibleHover"]) || $attributes["visibleHover"])
308-
$this->_visibleOver($button);
309-
return $button;
310-
}, $index,$attributes);
311-
}
312294

313-
protected function _visibleOver($element){
314-
$this->_visibleHover=true;
315-
return $element->addToProperty("class", "visibleover")->setProperty("style","visibility:hidden;");
316-
}
317295

318296
protected function getTargetSelector() {
319297
$result=$this->_targetSelector;

Ajax/semantic/widgets/datatable/DataTableFieldAsTrait.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
namespace Ajax\semantic\widgets\datatable;
33
use Ajax\semantic\html\elements\HtmlButton;
44
use Ajax\semantic\widgets\base\InstanceViewer;
5+
use Ajax\semantic\html\base\HtmlSemDoubleElement;
56

67
/**
78
* @author jc
@@ -61,6 +62,30 @@ private function getFieldButton($caption,$visibleHover=true){
6162
return $bt;
6263
}
6364

65+
/**
66+
* Creates a submit button at $index position
67+
* @param int $index
68+
* @param string $cssStyle
69+
* @param string $url
70+
* @param string $responseElement
71+
* @param array $attributes associative array (<b>ajax</b> key is for ajax post)
72+
* @return \Ajax\semantic\widgets\datatable\DataTable
73+
*/
74+
public function fieldAsSubmit($index,$cssStyle=NULL,$url=NULL,$responseElement=NULL,$attributes=NULL){
75+
return $this->_fieldAs(function($id,$name,$value,$caption) use ($url,$responseElement,$cssStyle,$index,$attributes){
76+
$button=new HtmlButton($id,$value,$cssStyle);
77+
$button->postOnClick($url,"$(event.target).closest('tr').find(':input').serialize()",$responseElement,$attributes["ajax"]);
78+
if(!isset($attributes["visibleHover"]) || $attributes["visibleHover"])
79+
$this->_visibleOver($button);
80+
return $button;
81+
}, $index,$attributes);
82+
}
83+
84+
protected function _visibleOver($element){
85+
$this->_visibleHover=true;
86+
return $element->addToProperty("class", "visibleover")->setProperty("style","visibility:hidden;");
87+
}
88+
6489
/**
6590
* Inserts a new Button for each row
6691
* @param string $caption

0 commit comments

Comments
 (0)