GithubHelp home page GithubHelp logo

stnguyen / ext.ux.sliderwithbars Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 2.0 1.49 MB

Sencha Touch 2 component: Slider with customizable progress bars inside

Home Page: http://stnguyen.com

JavaScript 100.00%

ext.ux.sliderwithbars's Introduction

Ext.ux.SliderWithBars

Introduction

This is a Sencha Touch 2 component, extending Ext.slider.Slider with the abilility to put customizable progress bars inside.

Demo

How to use

  1. Copy slider_with_bars folder into your project root folder.

  2. Include files:

     <link rel="stylesheet" href="slider_with_bars/style.css" type="text/css">
    
     <script type="text/javascript" src="slider_with_bars/bar.js"></script>
     <script type="text/javascript" src="slider_with_bars/slider.js"></script>
    
  3. Usage

     {
       xtype: "slider-with-bars",
       value: 15,
       barValue: [70, 15],
       id: 'mySlider',
       barCls: ['', 'x-bar-orange']
     },
    

API

This component extends Ext.slider.Slider, so all functions provided by its parent class are inherited unchanged.

Set the number of bars and their values

The number of bars is derived from the length of barValues array being passed in, so this line will create 3 bars:

mySlider.setBarValue([70, 30, 10]);

Note: because later bar (in the array above) will overlay the previous ones, so the bar with bigger value should be put on top.

Set css classes for each bar

You can customize each bars' style by applying css classes to them.

mySlider.setBarCls(['', 'x-bar-orange', 'x-bar-green']);

The number of css classes in the array should be equal to the number of bars created.

License

Copyright (c) 2012 [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

ext.ux.sliderwithbars's People

Contributors

stnguyen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ext.ux.sliderwithbars's Issues

SliderWithBars.js Not Found

Hi

I downloaded your code, copied it to touch/src/ux, included files in my index.html as per your example, but unfortunately Sencha then complains about not being able to find SliderWithBars.js. I'm definately doing something silly.

Any chance you could provide a few bullet points on including your ux within a Sencha MVC app structure?

Many thanks
Rgds
Zac

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.