aFarkas/remote-list là dự án mã nguồn mở trên GitHub với 54 sao, viết chủ yếu bằng JavaScript. super lightweight autocomplete
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
An ultra lightweight autosuggest / autocomplete plugin
An ultra lightweight autocomplete / autosuggest plugin with a simple but powerful API. Leverages the HTML5 datalist element to build an extreme lightweight autosuggest plugin. Can use webshim to polyfill old browsers or enhance modern ones.
extreme lightweight (~1.5kb compressed/gzipped)
simple, intuitive API
includes powerful caching
performs server friendly AJAX requests (no multiple requests at once, no requests for older value hints)
allows customized rich markup content (not only value and label) *
allows different filtering or other behavior customization *
The options can be set using the jQuery.fn.remoteList() method or by using the data-remote-list attribute on the given element.
The $.fn.remoteList plugin has the following options:
minLength
maxLength
param
source
select
renderItem
Examples:
$('input.autosuggest').remoteList({
minLength: 4,
source: "my-ajax-service.json"
});
//or
<input data-remote-list='{"minLength": 4, "source": "my-ajax-service.json"}' class="autosuggest" type="search" />
//in case the data-remote-list is not a JSON object, but a simple string, it is considered as the `source` option
<input data-remote-list="my-ajax-service.json" class="autosuggest" type="search" />
minLength: (Number default: 2)
The minimum number of characters a user must type before a search is performed. Zero is useful for local data with just a few items, but a higher value should be used when a single character search could match a few thousand items.
The maximum number of characters a new search should be tried. Otherwise the data from cache is used. If the user copies more characters at once into the input field and there is no cached data, the string will be shortened and then requested.
In case of static data this number should be set to 0 so a search is only done once.
The name of the query parameter used for AJAX service.
<input name="q" data-remote-list='{"source": "get-data.json", "param": "term"}' />
<!-- use the query name 'term' instead of 'q' -->
source: (mixed: String or Function)
The data source for the suggestions. The data will requested with each user input as long as the user input satisfies the minLength and the maxLength option.
String: When a string is used, the plugin expects that string to point to a URL resource that will return JSON (or JSONP) data.
Function: The function callback offers much flexibility. It serves as a simple data provider. And should be used, if the request or response has to be modified.
The function receives the following arguments:
value: The value the suggestions should be based on
response: A callback function which expects a single argument: the data to suggest to the user.
reset/fail: A callback function, which should be invoked, if the data couldn't be retrieved
request: An object with a single property with name of param and the value.
source: Either the source url or the function itself.
The data provided by the either the source URL or the source function should be either an array of strings representing the values or an array of objects with the key value and an optional label key.
select: (Function)
A callback function, which is invoked, if the user selects an item of the suggestion list. The selected item can be retrieved with the method selectedOption and the selected data can be retrieved with method selectedData.
All methods can be invoked by passing the method name as a string to the $.fn.remoteList plugin. Additional parameters are passed as an array as the second parameter:
Returns the first option element in the datalist, which has the same value, than the associated input element. If no option is found, it will return null. Normally this method is used in a listselect event listener or the select callback function.
var option = $('.autosuggest').remoteList('selectedOption');
selectedData
Returns data associated with the selectedOption. If no option/data is found, it will return null. Normally this method is used in a listselect event listener or the select callback function.
var data = $('.autosuggest').remoteList('selectedData');
Builds a new suggestion list for the given searchValue, if minLength and maxLength options are met. The searchValue parameter has to be wrapped into an array.
aFarkas/remote-list có 54 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/aFarkas/remote-list. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
aFarkas/remote-list có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho aFarkas/remote-list. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
aFarkas/remote-list còn đang phát triển không?
Commit gần nhất trên aFarkas/remote-list là 11.0 năm trước (theo timestamp GitHub). Repo có 13 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
aFarkas/remote-list viết bằng ngôn ngữ gì?
aFarkas/remote-list chủ yếu viết bằng JavaScript. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc thêm về aFarkas/remote-list ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/aFarkas/remote-list là nguồn chính thức.
Đọc đầy đủ README ở tab phía trên.
remote-list có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về remote-list.