-
Notifications
You must be signed in to change notification settings - Fork 139
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
Grabbing data from multiple select #351
Comments
Try this: <select name="multiSelect" multiple materialize="material_select" [(ngModel)]="multiSelectedOptions" [materializeSelectOptions]="selectOptions">
<option value="" disabled selected>Choose your option</option>
<option *ngFor="let option of selectOptions" [value]="option.value">{{option.name}}</option>
</select>
<label>Materialize Multi Select ({{multiSelectedOptions}})</label> multiSelectedOptions = "";
selectOptions = [
{value:1,name:"Option 1"},
{value:2,name:"Option 2"},
{value:3,name:"Option 3"}
] |
thanks for the response. this is now my error message now... I installed using the instructions found in the tutorial and am using Angular CLI
I slightly altered the code you gave me to accommodate my User being created. This is now my user-new.component.html followed by my user-new.component.ts.
|
@rubyboy (sorry am I supposed to include this. If not I won't in future) beside the error. it seems like its working. I'm wondering if I even need to worry about it! |
my project is right here if that helps.
I installed with the Angular CLI instructions... Any help would be awesome! |
@rockomatthews I've downloaded your project, npm installed and served. All looking great, with multi selected working as expected. What am I missing? |
@rubyboy It works for me as well... at least to me it seems its working... but when I click on the initial option, I get this error message I just tried the tooltip and that seems to work... |
Is it that I am not importing MaterializeDirective anywhere? I feel like I keep coming across examples that contain this import within the app.module.ts but it isn't necessary import MaterializeDirective for CLI, right?
|
@rubyboy can you see anywhere that might be causing this for me and not you? I want to make sure this isn't an issue before I move forward. |
@rubyboy sorry to bug but I think I have advanced. I cloned the project I provided a link to and reinstalled everything in a new folder. Now the material_select is flashing no error but it is closing after every time I select an option... is this a a familiar issue to you? |
its very strange. If I am one user signed into chrome on my main google account, it works perfectly yet flashes this error and reloads all the time without intention to reload. This is the error.
Then occassionally this error will pop restricting anything on the page from loading..
However, when I go to localhost:4200 in a new chome window that has no extension or into the "brave" browser, the mulitSelect doesn't stay open upon selecting an option. Yet it works and there aren't any errors like the above... It also doesn't reload without intending to make it do so. I think it's safe to say this is the method I should rely on... it's also is acting like this in Firefox. I think I'm close!!!! Thanks for looking into with me. Extremely appreciated. |
@rubyboy any ideas.. I'm hoping to clear this today so I can keep rocking through this project. As I mentioned before, now it appears to be working fine but still closes after every option select forcing you to reopen the select options and click the next one... then the same effect. It closes as if you clicked outside the select drop down. I remember seeing an issue that I think concerned the same issue. I just wasn't experiencing it at the time and can't find it again! Alsoif, for instance, the example above's error message, becomes irrelevant... should I edit it out of my comment? It was due to an extension called "page x-ray" that I had that was providing that error. Interestingly enough though, that was the example that looked like it worked perfectly but threw the above error... |
The problem with multi select closing upon each selection is a known (unsolved yet) one: #337 |
@rubyboy ah ok. Cool. I will just keep moving forward pretending it works. I believe its only a visual issue. God, I knew I saw something somewhere that described this issue. I searched all over with keywords like "multi_select clsoing" etc. Don't know how I missed that thread. Sorry. Thanks for the heads up |
No worries. Thanks for the feedback. |
I'm using angular4 and have my user register has multiple select filed. Its works and looks good, but I don't know how to capture the checked options. How would I group them into an array that is empty with the user I create? Here's my user-new.component.html and my user-new.component.ts...
I am guessing I should declare an empty array in the component to push the selected options to but I'm not sure... Any help would be great. Thanks!
user-new.component.html
user-new.component.ts
The text was updated successfully, but these errors were encountered: