Skip to content

Conversation

@perdodi
Copy link

@perdodi perdodi commented Oct 3, 2017

Makes possible to disable options in <select> dropdowns.

Example:

{
    name: "Country",
    type: "select"
    items: [
         { Name: "United States", Id: 0 },
         { Name: "Canada", Id: 1, disabled: true },
    ],
    valueField: "Id",
    textField: "Name"
}

Copy link
Owner

@tabalinas tabalinas left a 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)

.appendTo($result);


$option.prop("disabled", (disabled === true));
Copy link
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.

var value = valueField ? item[valueField] : index,
text = textField ? item[textField] : item;
text = textField ? item[textField] : item,
disabled = item['disabled'];
Copy link
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).

@zxcmaurya
Copy link

zxcmaurya commented May 30, 2018

Hello, I need to do same operation in my code. I need to disable <option> once it selected and inserted as a row in grid. Please help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants