GithubHelp home page GithubHelp logo

hoangjk / nativescript-range-seek-bar Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 13.0 5.74 MB

A NativeScript Range Seek Bar widget.

License: Apache License 2.0

HTML 5.95% TypeScript 59.66% CSS 0.31% Shell 2.51% Ruby 0.07% JavaScript 31.49%

nativescript-range-seek-bar's People

Contributors

hoangjk avatar inno-hoangle avatar sartxi avatar socalrunner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nativescript-range-seek-bar's Issues

Label

Hello, I'd like to know how to add label above the Thumbs, is it possible?

NS 7 - Update

Hi,

I've seen that you have updated your plugin for NS7. When new version will be available on npm?

Thanks.

Nativescript vue

I am using vue in nativescript. Can you also provide this on Nativescript Vue?

Can you add a VanillaJS example?

Seems like a great plugin but I don't use angular. Is it possible to use with Vanilla javascript, if so could you please add an example?

Swift 4.0 compatibility

Hi, we really like your plugin and would like to continue using it. Do you plan to update this plugin to Swift 4.0 compatibility? Xcode no longer supports building for Swift 3.0 so we will be forced to move away from this plugin unless it is updated to Swift 4.0.

Problems with selecting range

Hi. I made a short video displaying the problems I've been having with the slider. In the beginning, I'm trying to move the left thumb all the way to the right, but instead both thumbs start moving towards each other.
Then if I move right thumb towards the left, it pushes the left thumb towards the right.

https://drive.google.com/open?id=0BymBePlGK3mJSHdFVE93TU94ZHlnV2UybTJpYXRMc2VXd2RR

Here's the complete code:

<Page loaded="onLoaded" shownModally="onShowModally" navigatingFrom="onClose" xmlns="http://schemas.nativescript.org/tns.xsd" actionBarHidden="true"
	xmlns:rsb="nativescript-range-seek-bar" >

  <GridLayout rows="50,*,50">
  	<Label row="0" text="Filter Results" class="m-15" />
  	<StackLayout row="1" class="p-15">
			<Label text="Weight" class="h3 text-black m-b-10" />
			<StackLayout>
				<rsb:RangeSeekBar class="range-seek-bar" minValue="{{ minWeight }}" maxValue="{{ maxWeight }}" minStartValue="{{ weightLow }}" maxStartValue="{{ weightHigh }}" step="{{ step }}" minRange="1" rangeSeekBarChanged="weightChanged" />
			</StackLayout>
			<!-- <rsb:RangeSeekBar class="range-seek-bar" minValue="0" maxValue="100" minStartValue="20" maxStartValue="80" step="1" rangeSeekBarChanged="weightChanged" />  This works fine -->
			<GridLayout columns="1*,2*,1*">
				<label col="0" text="{{ minWeight }}" />
				<Label col="1" text="{{ weightLow+' to '+weightHigh+' gms' }}" class="h3 text-black" horizontalAlignment="center" />
				<label col="2" text="{{ maxWeight }}" horizontalAlignment="right" />
			</GridLayout>
	  </StackLayout>
		<GridLayout row="2" columns="1*,1*" height="50">
			<GridLayout col="0" class="bg-secondary" height="100%" tap="cancelSort">
				<Label col="0" text="Cancel" class="h3 center" verticalAlignment="center" />
			</GridLayout>
			<GridLayout col="1" class="bg-primary" height="100%" tap="applySort">
				<Label col="0" text="Apply" class="h3 text-black center" verticalAlignment="center" />
			</GridLayout>
		</GridLayout>
	</GridLayout>
</Page>
const observableModule = require("data/observable");
var page;
var filterVM;
var closeCallback;
var filters = {};

exports.onLoaded = function(args) {
  page = args.object;

  filterVM = new observableModule.Observable();
  page.bindingContext = filterVM;
}

exports.weightChanged = function(event) {
  console.log("rangeSeekBarChanged: ", event.value);
  if(filterVM != undefined){
    filterVM.set("weightLow", event.value.minValue);
    filterVM.set("weightHigh", event.value.maxValue);
  }
}

exports.onShowModally = function(args){
  var context = args.context;
  closeCallback = args.closeCallback;

  console.log(context);
  filterVM.set("minWeight", Math.floor(9.90));
  filterVM.set("maxWeight", Math.ceil(190.00));
  filterVM.set("weightLow", Math.floor(9.90));
  filterVM.set("weightHigh", Math.ceil(190.00));

  var step = Math.round((context.maxWeight - context.minWeight)/40)
  filterVM.set("step", 1);
  // filterVM.set(context, true);
}

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.