function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Marry SteinMarry Stein 

Lightning:Slider to change object value

Hey guys,

i want to check the new possabilitys with lightning. I am familiar with visualforce but not lightning components. I definitely will learn to create some components , but at this moment i am looking for coll "widgets". I like how the slider works and want to create one for the opportunity object to change a number or percent field. 

Does anyone have a solution for that ?  It would be great to see some cool stuff in lightning! 

Greetings Marry 
Raj VakatiRaj Vakati
sample code
aura:component controller="ContactSlider">
    <aura:attribute name="val" default="5" type="Integer"/>
    <aura:attribute name="contacts"  type="Contact[]"/>
    <lightning:slider step="5" 
                      onchange="{! c.handleRangeChange }" 
                      min="5" max="50" 
                      label="Slide to see the contact"/>
    <table class="slds-table slds-table--bordered "
                <th class="slds-is-sortable slds-cell-wrap" scope="col">
                <th class="slds-is-sortable slds-cell-wrap" scope="col">
                <th class="slds-is-sortable slds-cell-wrap" scope="col">
            <aura:iteration var="con" items="{!v.contacts}">
                <tr class="slds-hint-parent">
                    <td role="gridcell" class="slds-cell-wrap" data-label="Role">
                        <div class="">{!con.FirstName}</div>
                    <td role="gridcell" class="slds-cell-wrap" data-label="Role">
                        <div class="" data-label="Role">{!con.LastName}</div>
                    <td role="gridcell" class="slds-cell-wrap" data-label="Role">
                        <div class="" data-label="Role">{!con.Email}</div>
    handleRangeChange: function (component, event) {
        var action = component.get("c.getContacts");
        action.setParams({limitfromSlider :event.getParam("value") });
        action.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                component.set("v.contacts", response.getReturnValue());
            else {
                console.log("Failed with state: " + state);
public class ContactSlider {
    public static List<Contact> getContacts(integer limitfromSlider){
        return [Select FirstName ,LastName , Email from Contact Limit :limitfromSlider ];

Marry SteinMarry Stein
Hi Raj, 

thanks for your reply, but its not exactly what i am looking for. I will give it try. Maybe i can figure it out myself. Thanks ! :)