Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to add extra option?
Message
De
17/09/2014 12:15:29
 
 
Information générale
Forum:
Javascript
Catégorie:
Autre
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01607633
Message ID:
01607737
Vues:
55
>>>So, that option generates bad request. Why if I change value="0" it doesn't show at all? Do you see the reason?
>>
>>It doesn't show because it doesn't get added. As to why it doesn't get added - I don't know. There's an interaction there with angular generated HTML so anything could be happening - even if you found a working solution for now there's no guarantee that a future version of angular might cause it to break.....
>>
>>Best stick with one of the solutions I suggested...
>
>I'll try server side solution. As I said, I tried JavaScript solution in the controller and again it was not added!!!

Works for me. Are you saying unshift() didn't add it to the array or that it did but it didn't show up in the dropdown?

>BTW, there will be an additional twist. In that form the item tree id will be required (not 0) for some cases and non required (can be 0) for other cases.
>
>Do you know what will be the best way to handle this scenario? Should I do something like
>\ng-required = "someFunction()" for this and in that function check for 0 in the value?

Not entirely sure what you mean but if you don't want the option to be available then isn't it simpler (and more intuitive for the user) just to remove it on the client side - or just don't add it in the first place. Failing that the I'd think a directive might be better than ng-required ?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform