angular-validation icon indicating copy to clipboard operation
angular-validation copied to clipboard

Integration with angularjs-dropdown-multiselect

Open gustavolira opened this issue 11 years ago • 14 comments

Hi, It would be nice if this plugin had support with angularjs-dropdown-multiselect. https://github.com/dotansimha/angularjs-dropdown-multiselect

gustavolira avatar Sep 08 '15 13:09 gustavolira

+1

newpaulinhu avatar Sep 08 '15 13:09 newpaulinhu

+1

RobsonMathias avatar Sep 08 '15 13:09 RobsonMathias

+1

dpr001 avatar Sep 08 '15 14:09 dpr001

+1

JosielSantos avatar Sep 08 '15 14:09 JosielSantos

+1

trsenna avatar Sep 08 '15 14:09 trsenna

Thanks for the suggestions but I don't currently support 3rd addons, which is the case for both your requests #66 and #67. If you want to help and make a pull request, that would be great else I don't really have much of my personal time to spend on something that I don't use myself. I have other priorities.

Talking more about the subject, 3rd party addons are in most cases, which seems true for both your requests, are using wrapper and change the input value input something completely different, most of the time new <div>, my library is for getting values of something that exist on current element, I don't really want to spend my time on finding something that might exist somewhere else in the DOM. Also trying to find and validate a new element that would need to be found in the DOM, would be a performance killer and would also be completely different from 1 addon versus another (for example your ng-tags-input doesn't have the same wrapper as dropdown-multiselect does).

So unless you want to spend the time on working on this, I don't really want to do that. And I would prefer to accept something that is generic, meaning that it would work with any type of 3rd party addon, but I wouldn't know how deal with that at this point.

Oh and having your friends to do +1 won't change much... what would make a huge difference is someone to help!

ghiscoding avatar Sep 08 '15 23:09 ghiscoding

Thinking a bit more about this and what could possibly be done to make it more generic is maybe to have a common attribute that is bind to the result, then inside the validation I could use that result to validate. The new attribute would have to be name that could be re-used no matter what 3rd party addon you use.

Something like this maybe (where validation-result would be a new attribute)

<div 
    ng-dropdown-multiselect="" 
    options="example1data" 
    selected-model="example1model"
    validation="required"
    validation-result="example1model">
</div>

or your other 3rd party addon (with again the new attribute validation-result)

<tags-input ng-model="example1model"
    validation="required"
    validation-result="example1model">
</tags-input>

That might work and could still be generic with common attribute which Angular-Validation would know where to get his result and still be efficient I believe. But what I need to see inside the validation-result is flat result value, that might not work properly for validation of a certain value if your scope model is actually returning an id or something else that is not a flat result, then Angular-Validation might not know what to do with it, so in this case you might not always bind the scope model.

Please give feedback

ghiscoding avatar Sep 09 '15 12:09 ghiscoding

Thank you for your help.

It's a good idea, I will try implement this.

2015-09-09 9:44 GMT-03:00 Ghislain B. [email protected]:

Thinking a bit more about this and what could possibly be done to make it more generic is maybe to have a common attribute that is bind to the result, then inside the validation I could use that result to validate. The new attribute would have to be name that could be re-used no matter what 3rd party addon you use.

Something like this maybe (where validation-result would be a new attribute)

or your other 3rd party addon (with again the new attribute validation-result)

That might work and could still be generic with common attribute which Angular-Validation would know where to get his result.

— Reply to this email directly or view it on GitHub https://github.com/ghiscoding/angular-validation/issues/66#issuecomment-138897747 .

gustavolira avatar Sep 09 '15 14:09 gustavolira

what kind of validation are looking at doing, just required or a specific value(s)? Your ngModel seems to return an array of indexes (id), for a required, it's manageable but for a specific value the Angular-Validation would not know what to do with it... I mean, I don't want Angular-Validation to deal with indexes, it's meaningless and unmanageable

ghiscoding avatar Sep 09 '15 17:09 ghiscoding

This is coming, I hope all these +1 are going to change into +1 Star on the library.

ghiscoding avatar Sep 28 '15 21:09 ghiscoding

Done.. You can check the Wiki - 3rd party addon validation.

I will have a demo soon on Plunker as well, but for now you can look at code sample in the folder /more-examples/addon-3rdParty/ it has 3 different 3rd party addons.

Now all of your +1 please change them to Star

ghiscoding avatar Oct 05 '15 05:10 ghiscoding

The Plunker Demo is now available

ghiscoding avatar Oct 07 '15 04:10 ghiscoding

Demo is not working. Please provide a solution.

jinalkachariya26 avatar Dec 15 '17 13:12 jinalkachariya26

The demo is not working simply because 1 of the 3rd party lib link changed. The Wiki - 3rd party addons is still valid.

ghiscoding avatar Dec 15 '17 17:12 ghiscoding