Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
a simple implementation of a list chooser with a search and sort capability. Intended to be used as a component for mithril js.
This code is a simple implementation of a list chooser with a search and sort capability. Intended to be used as a component for mithril js. It includes methods to update the list on the fly and also set style in the config file. Made for mithril it intends to give a similar functionality to of the chosen plugin made for jquery.
For an example visit the jsFiddle link below or use the example provided in the repository. to use the component simple add the code in the lib to your js file either by require or using it directly and add it as a component in the main view of the mounted object. see below for more info
Live od jsFiddle Live on GitHub.io Usage:
Create an instance with a config:
var config = {
list: [], //the list
itemsPerPage: 10, //number of items shown in the list
sortByName: true, //sort
styles: {
width: "200px", //width of the list
selectedBackground: 'black',
selectedForeground: 'white',
background: 'white',
foreground: 'black'
}
};
var chosen = new MithChosen(config);
// The list may be updated at any time using the update() method.
chosen.update(['Tabriz', 'Istanbul','Karachi',
'Shanghai','Mumbai','Newyork',
'London','Adelaide','HongKong',
'Chicago','Baku','Cairo',
'Baghdad','Nairobi','Mexico']);
// or it can be provided when instantiating.
Add the component to your main view using mithrils m.component utilty and mount that object to the DOM.
var main = {
view: function(){
return m.component(chosen)
}
}
m.mount(document.body,main);
FAQs
a simple implementation of a list chooser with a search and sort capability. Intended to be used as a component for mithril js.
We found that mithchosen demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.