6 examples of 'kendo dropdownlist selected value' in JavaScript

Every line of 'kendo dropdownlist selected value' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
55function setSingleSelectOption(nextSelectedIndex, _isPopoverOpen = true) {
56 set(_state => ({
57 ..._state,
58 activeOption: nextSelectedIndex,
59 selectedOptions: [nextSelectedIndex],
60 isPopoverOpen: _isPopoverOpen,
61 }));
62}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

146function dropdown(id, onchange, current_value, item_list, disabled) {
147 //
148 // Creates a dropdown for toggling options.
149 //
150 // item_list format: [[label, value, disabled], [..], [..]]
151 //
152 var items_html = "";
153 for (i = 0; i < item_list.length; i++) {
154 var label = item_list[i][0];
155 var value = item_list[i][1];
156 var greyed = item_list[i][2];
157 items_html += `<option value="${value}" ${current_value == value ? "selected" : ""} class="${greyed ? "disabled" : ""}">
158 ${label}
159 </option>`;
160 }
161
162 return `<select id="${id}" class="${disabled ? "disabled" : ""}" onchange="${onchange}" onwheel="_onwheel(event, this)">${items_html}</select>`;
163}
20function setDropdownValues($dropdown, values, selectedValue) {
21 $dropdown.empty();
22 var optionsAsString = '';
23 // add an empty string to the beginning for empty selection
24 values.unshift('');
25 $.each(values, function () {
26 optionsAsString += "<option value='" + escapeHtml(this) + "'" + (selectedValue == this ? " selected='selected'" : "") + ">" + escapeHtml(this) + "</option>";
27 });
28 $dropdown.append($(optionsAsString));
29}
39selectValue(e) {
40 const listNode = this.refs['valuesList'];
41 let target = e.target || e.srcElement;
42 let isli = false;
43 while(!isli && target != null) {
44 if(target.parentNode == listNode) {
45 isli = true;
46 break;
47 }
48 target = target.parentNode;
49 }
50
51 if(isli) {
52 const value = target.textContent;
53 const valueElement = this.refs['valueElement'];
54 if(valueElement['textContent'] != value) {
55 valueElement['textContent'] = value;
56 if(this.props.onValueChanged) {
57 this.props.onValueChanged(value);
58 }
59 }
60 }
61}
45select(e){
46 this.selectEvent.emit(this);
47}
64function setMultipleSelectOptions(nextSelectedIndex) {
65 set(_state => {
66 const selectedOptionsArray = _state.selectedOptions.slice();
67
68 if (selectedOptionsArray.includes(nextSelectedIndex)) {
69 const index = selectedOptionsArray.indexOf(nextSelectedIndex);
70 selectedOptionsArray.splice(index, 1);
71 } else {
72 selectedOptionsArray.push(nextSelectedIndex);
73 }
74
75 return {
76 ..._state,
77 isPopoverOpen: true,
78 activeOption: nextSelectedIndex,
79 selectedOptions: selectedOptionsArray,
80 };
81 });
82}

Related snippets