Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion dist/jsgrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -2173,13 +2173,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'];

var $option = $("<option>")
.attr("value", value)
.text(text)
.appendTo($result);

$option.prop("disabled", (disabled === true));
$option.prop("selected", (selectedIndex === index));
});

Expand Down
6 changes: 4 additions & 2 deletions src/fields/jsgrid.field.select.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'];

Copy link
Copy Markdown
Owner

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).


var $option = $("<option>")
.attr("value", value)
.text(text)
.appendTo($result);


$option.prop("disabled", (disabled === true));

Copy link
Copy Markdown
Owner

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.

});

$result.prop("disabled", !!this.readOnly);
Expand Down