PHPackages                             tacoberu/nette-form-selectboxremote - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tacoberu/nette-form-selectboxremote

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tacoberu/nette-form-selectboxremote
===================================

Select, which load options from remote.

15JavaScript

Since May 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/tacoberu/nette-form-selectboxremote)[ Packagist](https://packagist.org/packages/tacoberu/nette-form-selectboxremote)[ RSS](/packages/tacoberu-nette-form-selectboxremote/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

SelectboxRemote
===============

[](#selectboxremote)

Select, which retrieves data remotely. Suitable for a large amount of data that we want to filter and load sequentially page by page.

Installation
------------

[](#installation)

```
composer require tacoberu/nette-form-selectboxremote

```

Usage
-----

[](#usage)

Just as in a normal selecbox you pass an array of values, here you pass a model providing values. The universal `CallbackQueryModel` can serve as a model, which will solve everything with callbacks. But it is possible to create a suitable implementation of the interface that provides the required data.

It might look something like this:

### Register extension

[](#register-extension)

Add `addSelectRemote()` and `addMultiSelectRemote()` shortcuts to the container:

```
extensions:
	- Taco\Nette\Forms\Controls\SelectBoxRemoteExtension

```

### Javascript

[](#javascript)

A javascript handler needs to be added, for example:

```

		$(function () {

			/**
			 * Support Select2 for SelectBoxRemoteControl.
			 * https://select2.github.io/
			 * @node-attr data-data-url Zdroj dat. { items, isMoreResults }
			 */
			$('select').each(function() {
				if ($(this).data('class') == 'filterable' || $(this).data('type') == 'remoteselect') {
					var opts = {};
					if ($(this).data('type') == 'remoteselect') {
						opts.ajax = {
							url: function() {
								return $(this).data('data-url');
							},
							dataType: 'json',
							delay: 250,
							data: function (params) {
								return {
									term: params.term, // search term
									page: params.page
								};
							},
							processResults: function (data, params) {
								// parse the results into the format expected by Select2
								// since we are using custom formatting functions we do not need to
								// alter the remote JSON data, except to indicate that infinite
								// scrolling can be used
								params.page = params.page || 1;
								return {
									results: data.items.map(function(x) { return {
										id: x.id,
										text: x.label,
									};}),
									pagination: {
										more: (params.page * 10) label, $term) === False) {
			continue;
		}
		$results[] = (object) [
			'id' => $x->id,
			'label' => $x->label,
		];
	}
	$total = count($results);
	$offset = ($page - 1) * $pageSize;
	return (object) [
		'total' => $total,
		'items' => array_slice($results, $offset, $pageSize),
	];
}, function($id) use ($data) {
	foreach ($data as $x) {
		if ($x->id === $id) {
			return $x;
		}
	}
});

// ...

$form->addSelectRemote('category', 'Category:', $categorySelectQueryModel);
$form->addMultiSelectRemote('tags', 'Tags:', $tagsSelectQueryModel);
```

[![](assets/remoteselect-form.png)](assets/remoteselect-form.png)

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4d9535bc57ab9e7c844b76be57d024b97eb84e9f8a9d308537afffe9cf81c409?d=identicon)[tacoberu](/maintainers/tacoberu)

---

Top Contributors

[![tacoberu](https://avatars.githubusercontent.com/u/1828339?v=4)](https://github.com/tacoberu "tacoberu (6 commits)")

### Embed Badge

![Health badge](/badges/tacoberu-nette-form-selectboxremote/health.svg)

```
[![Health](https://phpackages.com/badges/tacoberu-nette-form-selectboxremote/health.svg)](https://phpackages.com/packages/tacoberu-nette-form-selectboxremote)
```

###  Alternatives

[alexandresalome/assetic-extra-bundle

Extra feature for Assetic (asset directory)

1811.4k](/packages/alexandresalome-assetic-extra-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
