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

[RFR] Use UI-Select for Choice and Choices fields #505

Merged
merged 8 commits into from
Jun 15, 2015
Merged

Conversation

jpetitcolas
Copy link
Contributor

It adds select filtering and a better UI for multi-selects.

Before:
old_anim

Now:
anim

It will especially be useful to populate live select lists using AJAX requests.

Tasks:

  • Implement UI-Select library
  • Prevent ENTER from submitting the form when in select list
  • Update or create tests to ensure we use this lib

@fzaninotto
Copy link
Member

Promising!

**Tip:** if you are working on Karma tests, you can prevent from relaunching the whole process by disabling single-run:

```
KARMA_SINGLE_RUN=false grunt karma:unit
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Special focus on this line. May save a lot of time!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has already been changed. This is not native to Karma, this is specific to ng-admin. See Gruntfile changes.

@jpetitcolas
Copy link
Contributor Author

Miss a last point on this PR: Prevent ENTER from submitting the form when in select list. Working on it. As I'm not sure if it depends from ng-admin or from ui-select, switching this one as RFR.

@jpetitcolas jpetitcolas changed the title [WIP] Use UI-Select for Choice and Choices fields [RFR] Use UI-Select for Choice and Choices fields Jun 12, 2015
@jpetitcolas
Copy link
Contributor Author

Back to WIP: multiple choices required constraint is not taken into account.

scope.v = field.validation();

var template = `
<ui-select ${scope.v.required ? 'ui-select-required' : ''} multiple ng-model="$parent.value" ng-required="v.required" id="{{ name }}" name="{{ name }}">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not proud of this, but ng-attr-ui-select-required did not work.

@jpetitcolas
Copy link
Contributor Author

Back to RFR.

ThieryMichel added a commit that referenced this pull request Jun 15, 2015
[RFR] Use UI-Select for Choice and Choices fields
@ThieryMichel ThieryMichel merged commit 43c650d into master Jun 15, 2015
@ThieryMichel ThieryMichel deleted the select2 branch June 15, 2015 07:24
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.

3 participants