Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto complete Appearing behind the Modal popup

I am using simple jquery popup and Auto complete of jQuery Auto complete .The code of Auto complete is something like this.

$("#tags").autocomplete({
    source: NameArray
});

where tags is the textbox id and NameArray is Array of string.However this code in the Modal pop-up like this-

function openFilterPopUp() {

    $("#tags").autocomplete({
        source: NameArray
    });
    $("#openFilterPopUp").dialog({
        resizable: false,
        height: 240,
        modal: true,
        buttons: {
            "ok": function() { $(this).dialog("close"); },
            Cancel: function() { $(this).dialog("close"); }
        }
    });

}

The data for Autocomplete is appearing fine but its appearing behind the popup.Please Help. Any help will be appreciated.

like image 303
coolhimanshu Avatar asked Mar 12 '14 06:03

coolhimanshu


1 Answers

Add appendTo property of autocomplete

$("#tags").autocomplete({
    source: NameArray,
    appendTo : _parentElement
});

_parentElement can be your modal body

like image 177
mulla.azzi Avatar answered Sep 28 '22 08:09

mulla.azzi