Giter Site home page Giter Site logo

vivekvs1 / dash-dual-listbox Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 10.0 329 KB

Dual listbox for Dash. Original component: https://rawgit.com/jyotirmaybanerjee/react-duallist/master/example/examples.html#

Python 44.67% JavaScript 29.83% HTML 0.58% CSS 24.92%

dash-dual-listbox's People

Contributors

bachibouzouk avatar chriddyp avatar mungojam avatar t4rk1n avatar vivekvs1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

dash-dual-listbox's Issues

Callback not working

I'm using the "Usage.py" example code (with comments removed and "Display" Div added) and the Dual Listbox is shown, but I can't get the callback to fire. Is this example current?

from dash_dual_listbox import DualList
import dash
from dash.dependencies import Input, Output
import dash_html_components as html

app = dash.Dash('')

app.scripts.config.serve_locally = True
app.css.config.serve_locally = True

app.layout = html.Div([
    DualList(id='DualList', available=[{'label': 'sdf', 'value': 'AL'},
                                       {'label': 'Alassdfsdfka', 'value': 'AK'},
                                       {'label': 'Arizona', 'value': 'AZ'},
                                       {'label': 'Arkansas', 'value': 'AR'},
                                       {'label': 'California', 'value': 'CA'},
                                       {'label': 'Colorado', 'value': 'CO'},
                                       {'label': 'sdfg', 'value': 'CT'},
                                       {'label': 'Delaware', 'value': 'DE'},
                                       {'label': 'Florida', 'value': 'FL'},
                                       {'label': 'Georgia', 'value': 'GA'}],
             selected=['AL']),
    html.Div(id='display', children=[])
])


@app.callback(Output('display', 'children'),
              [Input('DualList', 'selected'),
               ])
def display_output(c):
    return c[0]

if __name__ == '__main__':
    app.run_server(debug=True)

Cannot find bundle.js

Installed via pip and tried a minimal example but get the following:
localhost/:26 GET https://unpkg.com/my_dash_component/dash_dual_listbox/bundle.js net::ERR_ABORTED 404

Add selectedLeft and selectedRight properties

The selecetedLeft and selectedRight properties would contain the indexes of available options that are selected/highlighted in the respective listbox before any of the buttons of the dash-dual-listbox is pushed. This allows to add additional buttons that allow the user to modify the content of the option labels, provided that the rendering of the dash-dual-listbox is simultaneously triggered.

React-duallist already exposes selectInLeft and selectInRight function properties that would allow to implement this in dash-dual-listbox. If my experiments prove succesful I will provide a PR for this.

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.