-
Notifications
You must be signed in to change notification settings - Fork 349
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
Added <option> disable. #933
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, take a look at couple nit comments.
Also keep dist/*
files unchanged (they changed only for released code)
src/fields/jsgrid.field.select.js
Outdated
|
||
var $option = $("<option>") | ||
.attr("value", value) | ||
.text(text) | ||
.appendTo($result); | ||
|
||
|
||
$option.prop("disabled", (disabled === true)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep indentation consistent: 4 spaces.
src/fields/jsgrid.field.select.js
Outdated
@@ -100,13 +100,15 @@ | |||
|
|||
$.each(this.items, function(index, item) { | |||
var value = valueField ? item[valueField] : index, | |||
text = textField ? item[textField] : item; | |||
text = textField ? item[textField] : item, | |||
disabled = item['disabled']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we use double-quotes usually, let's be consistent. While I'd rather just use dot notation here:
disabled = (item.disabled === true)
.
Hello, I need to do same operation in my code. I need to disable |
Makes possible to disable options in
<select>
dropdowns.Example: