Skip to content

Commit

Permalink
Add more options to remoteselect form widget
Browse files Browse the repository at this point in the history
  • Loading branch information
hkdobrev committed Dec 6, 2013
1 parent 787e6cc commit 402e951
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions classes/Kohana/Jam/Form/Tart/General.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ public function multiselect($name, array $options = array(), array $attributes =
'new_button' => NULL,
'search' => TRUE,
'template' => $template,
'templatestring' => Arr::get($options, 'templatestring', ''),
'list' => NULL,
'sortable' => NULL,
'label' => strtolower(Inflector::humanize($name)),
Expand All @@ -395,15 +396,17 @@ public function multiselect($name, array $options = array(), array $attributes =

$h('input', array('name' => $attributes['name'].'[]', 'type' => 'hidden', 'value' => ''));

$h('p', function($h) use ($name, $options) {
$h('p', function($h) use ($name, $options, $attributes) {

$h('input', array(
'id' => $attributes['id'],
'type' => 'text',
'placeholder' => Arr::get($options, 'placeholder', 'Search for '.$options['label']),
'data-provide' => 'remoteselect',
'data-provide' => Arr::get($options, 'provide', 'remoteselect'),
'data-source' => $options['source'],
'data-container' => '#'.$options['container'],
'data-url' => $options['new'],
'data-templatestring' => $options['templatestring'],
'style' => $options['search'] ? '' : 'display:none'
));

Expand Down

0 comments on commit 402e951

Please sign in to comment.