Skip to content

Commit

Permalink
override setValue method to set-up existing data easily
Browse files Browse the repository at this point in the history
  • Loading branch information
juzna committed Mar 19, 2011
1 parent d51e4a8 commit 6cccc2d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions DynamicContainerCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,23 @@ protected function fireOnChange() {

// </editor-fold>


/**
* Override: set values for this container while adding rows for it
* (needs https://github.com/nette/nette/pull/217 implemented in Nette)
*
* @param array $values
* @param bool $erase
* @return void
*/
public function setValues($values, $erase = FALSE) {
$this->clearRows();
foreach($values as $key => $sub) {
$this->createRow($key)->setValues($sub, $erase);
}
}


// <editor-fold defaultstate="collapsed" desc="register helpers">

public static function FormContainer_addDynamicContainerCore(FormContainer $_this, $name = null, $factoryCallback = null) {
Expand Down

0 comments on commit 6cccc2d

Please sign in to comment.