Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.widget("custom.leadsForConnections", {
- _create: function () {
- this.wrapper = $("<span>")
- .addClass("custom-combobox")
- .insertAfter(this.element);
- this.element.hide();
- this._createAutocomplete();
- this.element.bind("change", function () {
- this.input.val($(select).find("option:selected").text());
- });
- },
- _createAutocomplete: function () {
- var selected = this.element.children(":selected"),
- value = selected.val() ? selected.text() : "";
- this.input = $("<input>")
- .appendTo(this.wrapper)
- .val(value)
- .attr("title", "")
- .addClass("custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left")
- .autocomplete({
- delay: 600,
- minLength: 1,
- source: $.proxy(this, "_source")
- })
- .tooltip({
- classes: {
- "ui-tooltip": "ui-state-highlight"
- }
- }).focus();
- this._on(this.input, {
- autocompleteselect: function (event, ui) {
- ui.item.option.selected = true;
- this._trigger("select", event, {
- item: ui.item.option
- });
- },
- });
- },
- ...
- });
- <div class="g-hidden">
- <div class="box-modal" id="add_connection_modal">
- <div class="box-modal_close arcticmodal-close"><img id="closePopupImage"
- src="/images/icons/popup_icon_close.png"></div>
- <div class="label">{'TEXT_NAME'|tr}:
- </div>
- <div class="ui-widget spn">
- <select id="leadsForConnections" style="width:150px;">
- <option value="">Select one...</option>
- </select>
- </div>
- <span class="error_message" id="connection_error">Error</span>
- <span class="success_message" id="connection_success">Success</span>
- </div>
- </div>
Add Comment
Please, Sign In to add comment