Skip to content

Commit e1ce60b

Browse files
committed
input hidden bug fixed + hideColumn on Tables
1 parent acbd35d commit e1ce60b

File tree

5 files changed

+37
-2
lines changed

5 files changed

+37
-2
lines changed

Ajax/semantic/html/collections/menus/HtmlMenu.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ public function setHasContainer(){
240240
}
241241

242242
public function run(JsUtils $js){
243-
$this->onClick('if(!$(this).hasClass("dropdown")&&!$(this).hasClass("no-active")){$(this).addClass("active").siblings().removeClass("active");}',false,false);
243+
if($this->identifier!=="" && !isset($this->_bsComponent))
244+
$this->onClick('if(!$(this).hasClass("dropdown")&&!$(this).hasClass("no-active")){$(this).addClass("active").siblings().removeClass("active");}',false,false);
244245
$result= parent::run($js);
245246
return $result->setItemSelector(".item");
246247
}

Ajax/semantic/html/collections/table/HtmlTable.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,4 +372,15 @@ public function setActiveRowSelector($class="active",$event="click",$multiple=fa
372372
$this->_activeRowSelector=new ActiveRow($this,$class,$event,$multiple);
373373
return $this;
374374
}
375+
376+
public function hideColumn($colIndex){
377+
if($this->hasPart("thead")){
378+
$this->getHeader()->hideColumn($colIndex);
379+
}
380+
$this->getBody()->hideColumn($colIndex);
381+
if($this->hasPart("tfoot")){
382+
$this->getFooter()->hideColumn($colIndex);
383+
}
384+
return $this;
385+
}
375386
}

Ajax/semantic/html/content/table/HtmlTableContent.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,15 @@ public function conditionalCellFormat($callback, $format) {
278278
return $this;
279279
}
280280

281+
public function conditionalColFormat($colIndex,$callback,$format){
282+
$rows=$this->content;
283+
foreach ( $rows as $row ) {
284+
$cell=$row->getItem($colIndex);
285+
$cell->conditionnalCellFormat($callback,$format);
286+
}
287+
return $this;
288+
}
289+
281290
/**
282291
* @param mixed $callback
283292
* @param string $format
@@ -291,6 +300,15 @@ public function conditionalRowFormat($callback, $format) {
291300
return $this;
292301
}
293302

303+
public function hideColumn($colIndex){
304+
$rows=$this->content;
305+
foreach ( $rows as $row ) {
306+
$cell=$row->getItem($colIndex);
307+
$cell->addToProperty("style","display:none;");
308+
}
309+
return $this;
310+
}
311+
294312
/**
295313
* @param mixed $callback
296314
* @return HtmlTableContent

Ajax/semantic/widgets/base/FieldAsTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public function fieldAsHidden($index,$attributes=NULL){
187187
if(!\is_array($attributes)){
188188
$attributes=[];
189189
}
190-
$attributes["imputType"]="hidden";
190+
$attributes["inputType"]="hidden";
191191
return $this->fieldAsInput($index,$attributes);
192192
}
193193

Ajax/semantic/widgets/datatable/DataTable.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,4 +406,9 @@ public function setActiveRowSelector($class="active",$event="click",$multiple=fa
406406
return $this;
407407
}
408408

409+
public function hideColumn($colIndex){
410+
$this->getTable()->hideColumn($colIndex);
411+
return $this;
412+
}
413+
409414
}

0 commit comments

Comments
 (0)