Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python Lists translated to javascript objects in widgets #5020

Closed
jasongrout opened this issue Feb 4, 2014 · 0 comments · Fixed by #5023
Closed

Python Lists translated to javascript objects in widgets #5020

jasongrout opened this issue Feb 4, 2014 · 0 comments · Fixed by #5023
Assignees
Milestone

Comments

@jasongrout
Copy link
Member

From @ChakriCherukuri:

I just got the latest code from master and I am trying to create my custom widgets. One thing I noticed is that List() traitlet is no longer being mapped to an array on JS side. It is now mapped
into an object something like {0: v1, 1: v2, 2: v3, ...} as opposed to an array like [v1, v2, v3, ...]. It would be great if someone can look into this issue.

From @jasongrout: It looks like the javascript unpacker should be checking to see if the value is $.isArray before checking to see if it is an object here and handling arrays by creating a javascript array: https://github.com/ipython/ipython/blob/master/IPython/html/static/notebook/js/widgets/widget.js#L225.

Sources: #4374 (comment) (initial bug report), #4374 (comment) and #4374 (comment) track down the problem and outline a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants