Skip to content

ui-sortable options for array decorator #1

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

Merged
merged 1 commit into from
Aug 26, 2015

Conversation

crcornwell
Copy link
Contributor

This (tiny) change allows ui-sortable options to be passed into the directive via an optional sortOptions key on the form.

e.g. adding

"sortOptions": "{'cancel': 'ol'}" 

will disable sorting. This is particularly useful if you want certain arrays to be sortable but not all of them. It also opens up the ability to make use of all of the possible options listed here.

davidlgj added a commit that referenced this pull request Aug 26, 2015
ui-sortable options for array decorator
@davidlgj davidlgj merged commit 9ff94bf into json-schema-form:develop Aug 26, 2015
@davidlgj
Copy link
Contributor

Hi @devSoss, nice little PR! Thank you.

@crcornwell
Copy link
Contributor Author

Sure thing @davidlgj, happy to help! I also went ahead and updated the docs in the main repo so you can check that out when you get a chance.

@davidlgj
Copy link
Contributor

Hi again @devSoss, just a heads up. We've having some trouble with the options passed along as strings. In certain cases it seems like it throws an exception when no option is passed.

So I changed ui-sortable="{{form.sortOptions}}" to ui-sortable="form.sortOptions", which means you have to pass your config as an object, not as an string:

"sortOptions": {"cancel": "ol"'}

It's in develop right now but will come out next release.

@crcornwell
Copy link
Contributor Author

Ah okay, good catch @davidlgj, that slipped by me.

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

Successfully merging this pull request may close these issues.

2 participants