Closed fgnm closed 5 years ago
Sorry, I forgot to answer. I have updated @{options()}
, you can use disabled
key:
<select name="gender" required>
@{options([{name : '@(Gender)', value : '-', disabled: true }, {name : '@(Male)', value : 'M'}, {name : '@(Female)', value : 'F'}, {name : '@(Other)', value : 'Other'}]
</select>
Just install $ npm install total.js@beta
(it's stable).
I'm using that https://github.com/totaljs/framework/blob/493525b08d253b1f54a861ad3b3d4990c63a3ea2/index.js#L11801 function in html code to generate an options list and auto bind it with controller:
Controller:
It works well, but I need to set the first option (Gender = -) disabled. Reading the code I don't find a way to do that because $options does not accept custom attributes. Can you add this feature? Or maybe an helper function to create the whole
<select>
tag.Thank you