Giter VIP home page Giter VIP logo

Comments (10)

machineboy2045 avatar machineboy2045 commented on August 24, 2024

Thanks for taking the time to test this thing. I got it to work after
wrapping the selectize init inside a timeout. There must have been a race
condition involving the compilation of the parent directive. I also had to
change the options hash to an array. I thought it worked before with
hashes, but I guess Selectize needs an array. Here's the plunk
http://plnkr.co/edit/ZoQKrTzB0pVozQvsgAat?p=preview. If that works for you,
I'll add the changes to the master branch.

On Wed, Jun 11, 2014 at 4:18 AM, Michael [email protected] wrote:

Hi there again,

testing the limits of your directive once more I run into some trouble
when using it inside another directive. It is like it does not understand
selectize is a directive and does not compile it.
Take a look here to see what I mean.

http://plnkr.co/edit/N0uTQ18NW4v6bdV8K9HZ?p=preview


Reply to this email directly or view it on GitHub
#5.

from angular-selectize.

machineboy2045 avatar machineboy2045 commented on August 24, 2024

It's still adding an undefined option to the dropdown. I'll have to look at
it some more.

On Wed, Jun 11, 2014 at 9:20 AM, Will Jensen [email protected]
wrote:

Thanks for taking the time to test this thing. I got it to work after
wrapping the selectize init inside a timeout. There must have been a race
condition involving the compilation of the parent directive. I also had to
change the options hash to an array. I thought it worked before with
hashes, but I guess Selectize needs an array. Here's the plunk
http://plnkr.co/edit/ZoQKrTzB0pVozQvsgAat?p=preview. If that works for
you, I'll add the changes to the master branch.

On Wed, Jun 11, 2014 at 4:18 AM, Michael [email protected] wrote:

Hi there again,

testing the limits of your directive once more I run into some trouble
when using it inside another directive. It is like it does not understand
selectize is a directive and does not compile it.
Take a look here to see what I mean.

http://plnkr.co/edit/N0uTQ18NW4v6bdV8K9HZ?p=preview


Reply to this email directly or view it on GitHub
#5.

from angular-selectize.

masimplo avatar masimplo commented on August 24, 2024

hmmm ok, I am hanging tight. If there is anything I can help with let me know.

from angular-selectize.

machineboy2045 avatar machineboy2045 commented on August 24, 2024

I pushed a second version that uses 'replace' instead of 'transclude'.
Transclude was not what I meant to use. Now you will need to add the
directive to

or elements instead of . This solves an issue where ng-select would add an 'undefined' option before the directive could kick in. On Thu, Jun 12, 2014 at 3:14 AM, Michael [email protected] wrote: hmmm ok, I am hanging tight. If there is anything I can help with let me know. — Reply to this email directly or view it on GitHub https://github.com//issues/5#issuecomment-45851470 .

from angular-selectize.

masimplo avatar masimplo commented on August 24, 2024

It appears to render inside another directive now correctly but a couple of issues. First there is no way to set a placeholder since the markup is replaced with and second when the model contains a value at init, then an empty object is added to the options. (selectize.items[0] "? object:005 ?")

from angular-selectize.

machineboy2045 avatar machineboy2045 commented on August 24, 2024

Strange. I wonder if you were using the latest version. Also make sure to
use

or but not . I updated the directive so it will copy the placeholder attribute from the original element to the directive template and tested it in the various plnkrs. I think it should work. Let me know if not. On Sat, Jun 14, 2014 at 4:40 AM, Michael [email protected] wrote: It appears to render inside another directive now correctly but a couple of issues. First the Internet explorer took a nose dive again probably for a totally different reason, second, there is no way to set a placeholder since the markup is replaced with . Finally it stopped working outside of a directive (reverse behaviour) with the same symptoms — Reply to this email directly or view it on GitHub https://github.com//issues/5#issuecomment-46085597 .

from angular-selectize.

masimplo avatar masimplo commented on August 24, 2024

It seems there was something wrong with my jsfiddle setup for my previous comment (the one you have quoted) I have updated the comment to reflect the actual findings in a local test setup I ran.

Edit: placeholder seems to work great. I also tested required and disabled attributes and work fine on all occasions. Only problem left is the extra item generated when the value is prepopulated with items.

from angular-selectize.

machineboy2045 avatar machineboy2045 commented on August 24, 2024

I just found out I can specify placeholder in the Selectize config. I'm
going to remove support for setting it with placeholder attribute. Here's a
plnkr using your example and the latest version of the directive:
http://plnkr.co/edit/g5bDSP2ZKv0ItAw1Y75O?p=preview

On Sat, Jun 14, 2014 at 8:56 AM, Michael [email protected] wrote:

It seems there was something wrong with my jsfiddle setup for my previous
comment (the one you have quoted) I have updated the comment to reflect the
actual findings in a local test setup I ran.


Reply to this email directly or view it on GitHub
#5 (comment)
.

from angular-selectize.

masimplo avatar masimplo commented on August 24, 2024

Try adding a value now to the example that I have added an initial value in the directive (line 20: scope.item.selectedIndustries2 = ['ADMIN'];) and notice the last entry (undefined) that illustrates the issue I am talking about above
http://plnkr.co/edit/2sD1bOniTyPOlqXOQypv?p=preview

this seems related https://stackoverflow.com/questions/19884679/angular-js-ng-options-returns-object005 (not the reason and solution, but the side effect)

from angular-selectize.

machineboy2045 avatar machineboy2045 commented on August 24, 2024

I'm not sure if it's my directive, Angular select, or Selectize, but if you
change your options from a hash to an array of objects, then it works.

On Sat, Jun 14, 2014 at 9:20 AM, Michael [email protected] wrote:

Try adding a value now to the example that I have added an initial value
in the directive (line 20: scope.item.selectedIndustries2 = ['ADMIN'];) and
notice the last entry (undefined) that illustrates the issue I am talking
about above
http://plnkr.co/edit/2sD1bOniTyPOlqXOQypv?p=preview


Reply to this email directly or view it on GitHub
#5 (comment)
.

from angular-selectize.

Related Issues (20)

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.