diff --git a/classes/Kohana/Jam/Form/Tart/General.php b/classes/Kohana/Jam/Form/Tart/General.php index 280b16b..c8ba6a7 100644 --- a/classes/Kohana/Jam/Form/Tart/General.php +++ b/classes/Kohana/Jam/Form/Tart/General.php @@ -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)), @@ -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' ));