Skip to content

magsdk/component-value-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Value list component

build status npm version dependencies status devDependencies status Gitter

Value list is a component to build user interface, an instance of Component module.

Installation

npm install mag-component-value-list

Usage

Add the constructor to the scope:

var ValueList = require('mag-component-value-list');

Create value list instance:

var valueList = new ValueList({
    data: [11, 22, 35, 56, 78],
    cycle: true,
    render: function ( $body ) {
        $body.innerText = 'Number: ' + this.current.value;
    },
    events: {
        // current state was changed
        'data:change': function ( event ) {
            console.log(event);
        }
    }
});

To get current state:

console.log(valueList.current);

Development mode

There is a global var DEVELOP which activates additional consistency checks and protection logic not available in release mode.

Contribution

If you have any problems or suggestions please open an issue according to the contribution rules.

License

mag-component-value-list is released under the MIT License.

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy