Всплывающее окно Javascript не закрывается при выборе - PullRequest
0 голосов
/ 29 августа 2018

У меня есть эта функция, которая связана с элементом управления веб-форм, чтобы открывать всплывающее окно при нажатии на ссылку. Как только вы выберете нужный элемент и нажмете ссылку выбора рядом с перечисленным элементом во всплывающем окне, оно должно закрыть окно, но оно не закрывается. Я что-то упустил в своем коде?

function GetValues() {
    var selectedStore = "Store_SelectedStore";
    var selectedStoreId = document.getElementById(selectedStore);
    var selectedShipToStore = document.getElementById("Availibity_hSelectedShipToStore");
    var selectedServiceLevel = document.getElementById("Availibity_SelectedServiceLevel");
    var storeName = "Availibity_StoreName";
    var name = document.getElementById(storeName);
    var catalog = "Availibity_CatalogId";
    var catalogId = document.getElementById(catalog);
    var vendor = "Availibity_VendorId";
    var vendorId = document.getElementById(vendor);
    var Zip = "Availibity_txtZip";
    var storeZip = document.getElementById(Zip);
    var arrValues = new Array();

     debugger;
    if (selectedStoreId.value != "") {
        arrValues[0] = selectedStoreId.value;
        arrValues[1] = storeZip.value;
        arrValues[2] = name.value;
        arrValues[3] = vendorId.value;
        arrValues[4] = catalogId.value;
        arrValues[5] = selectedShipToStore.value;
        arrValues[6] = selectedServiceLevel.value;
    }
    console.log(arrValues);

    selectedStoreId.value = "";
    name.value = "";

    console.log(selectedStoreId.value)
    console.log(name.value)


    if (window.opener && !window.opener.closed) {
        window.opener.InStore(arrValues);
        // window.opener.location.reload();

        // window.open("close.htm", '_self');
    window.close();
    }


}

$(document).ready(function () {
    $(".autoclick").keyup(function (event) {
        if (event.keyCode == 13) {
            $(".searchbutton").click();
        }
    });
});
...