phloxcz/forms-combobox
最新稳定版本:v1.0.0
Composer 安装命令:
composer require phloxcz/forms-combobox
包简介
Searchable ComboBox form control for Nette Framework with AJAX-powered Selection datasource.
README 文档
README
Searchable ComboBox form control for Nette Framework backed by Nette\Database\Table\Selection.
Opens with the first N records on focus, filters via AJAX as the user types, and correctly pre-fills the label when opening an edit form – without an extra AJAX round-trip, even for a record deep in the dataset. Ships with built-in Bootstrap 5 and Tailwind CSS themes and full keyboard navigation.
composer require phloxcz/forms-combobox
Quickstart
1. Register the DI extension
# config/common.neon extensions: combobox: Phlox\Forms\ComboBox\ComboBoxExtension
2. Include assets
<link rel="stylesheet" href="{$basePath}/vendor/phloxcz/forms-combobox/assets/combobox.css"> <script src="{$basePath}/vendor/phloxcz/forms-combobox/assets/combobox.js" defer></script>
3. Add the field to your form
use Phlox\Forms\ComboBox\ComboBoxInput; $form->addComboBox('countryId', 'Country', $this->link('searchCountry!')) ->setSelection($this->db->table('countries'), 'id', 'name') ->setLimit(30) ->setTheme(ComboBoxInput::THEME_BOOTSTRAP);
4. Add a search signal to your presenter
public function handleSearchCountry(string $q = ''): void { $this->sendJson($this['form']['countryId']->fetchData($q)); }
5. Render the field in Latte
{label countryId /} {input countryId}
Documentation
Full documentation is in docs/README.md.
Requirements
- PHP 8.1+
- Nette Framework 3.1+ (
nette/application,nette/forms,nette/database,nette/di)
License
MIT
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-28