Skip to content

Commit 337a263

Browse files
committed
update DataForm for inverted
1 parent ac12b8e commit 337a263

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

Ajax/common/Widget.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ abstract class Widget extends HtmlDoubleElement {
6565
protected $_runned;
6666

6767
protected $_hasRules;
68-
68+
6969
public function __construct($identifier, $model, $modelInstance = NULL) {
7070
parent::__construct($identifier);
7171
$this->_template = "%wrapContentBefore%%content%%wrapContentAfter%";
@@ -543,4 +543,5 @@ public function getModelInstance() {
543543
public function hasRules() {
544544
return $this->_hasRules;
545545
}
546+
546547
}

Ajax/semantic/widgets/dataform/DataForm.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@
1818
* @property FormInstanceViewer $_instanceViewer
1919
*/
2020
class DataForm extends Widget {
21-
use BaseTrait;
22-
21+
use BaseTrait{
22+
setInverted as setInvertedTrait;
23+
}
24+
private $_inverted;
25+
2326
public function __construct($identifier, $modelInstance=NULL) {
2427
parent::__construct($identifier, null,$modelInstance);
2528
$this->_form=new HtmlForm($identifier);
@@ -41,6 +44,9 @@ public function compile(JsUtils $js=NULL,&$view=NULL){
4144
$this->_setToolbarPosition($form);
4245
}
4346
$this->content=JArray::sortAssociative($this->content, [PositionInTable::BEFORETABLE,"form",PositionInTable::AFTERTABLE]);
47+
if($this->_inverted){
48+
$this->content['form']->setInverted(true);
49+
}
4450
$this->_generated=true;
4551
}
4652
return parent::compile($js,$view);
@@ -165,4 +171,9 @@ public function addWrapper($index,$contentBefore,$contentAfter=null){
165171
public function run(JsUtils $js){
166172
parent::run($js);
167173
}
174+
175+
public function setInverted($recursive=true) {
176+
$this->setInvertedTrait($recursive);
177+
$this->_inverted=$recursive;
178+
}
168179
}

Ajax/semantic/widgets/datatable/DataTable.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,7 @@ public function autoPaginate($page = 1, $items_per_page = 10, $pages_visibles =
482482
* @param array $compileParts
483483
* @return DataTable
484484
*/
485-
public function refresh($compileParts = [
486-
"tbody"
487-
]) {
485+
public function refresh($compileParts = ['tbody']) {
488486
$this->_compileParts = $compileParts;
489487
return $this;
490488
}

0 commit comments

Comments
 (0)