24 $this->FieldRenderer(
$form);
32 $this->parent->add($this);
35 $this->related = reindexList(
$items, $this->
target->getPrimaryKey());
41 $this->table =
new DataListView(
null,
"connectables");
42 $this->table->rowId =
true;
44 $this->table->pageSize = 5;
45 $this->table->filter =
true;
46 $this->table->emptyMessage =
"There are no ".$this->target->prettifyClassName(
true).
" to select from";
48 $this->table->selectable =
true;
49 $this->table->selector(array($this,
'formatCheckbox'));
51 $this->
target->populateSelectionTable($this->table);
57 $pk = $item->getPrimaryKey();
58 $pkval = $item->get(
$pk);
60 $checked = array_key_exists($pkval, $this->related) ?
" checked='checked'" :
"";
62 return $item->format(
"<input type='checkbox' class='checkbox' name='{$pk}[]' id='{$pk}_{{$pk}}' value='{{$pk}}'{$checked}/>");
67 echo $this->table->writeScript();
72 echo $this->table->drawView();
static addConnection($source, $target)
Add a connection between the given source and target objects.
static getConnectedItems($sourceItem, $targetClass, $constraint="")
Returns the connected items for the specified source that are of the specified class.
static removeConnections($source, $targetClass)
Remove any connection that exists between the source and objects of the specified target class (inclu...
__construct($form, $field, $label, $targetClass)
static usingFeature()
Uses the specified framework feature(s).