ahmed salah

ahmed salah

  • 1.1k
  • 670
  • 42.5k

How to pass list of LICN_CIVIL_ID separated comma using java script ?

May 14 2024 9:02 PM

I work on java script i display data on gridview using javascript and it display success on gridview gvResults using function  GET_WORLD_BANK_LICN_DATA_REP()

so data display success on gridview gvResults  using function below without any issue 

my issue how to pass list of selected P_LICNS_CURInfo[i].LICN_CIVIL_ID that have checkbox checked true from gridview to button

as separated comma to function getselected_civilid when press button btnRequestSearch

so suppose i display data and select checkbox checked  for P_LICNS_CURInfo[i].LICN_CIVIL_ID as 1245,4321,7891,9918

then it will passed to function getselected_civilid() as "1245","4321","7891","9918" when press button below

<button type="button" id="btnRequestSearch" class="btn btn-outline-primary col-12" onclick="getselected_civilid();return false;">
                            <span style="font-size: 28px;">print</span><i class="far fa-hand-point-up fa-fw fa-2x pull-center"></i>
                        </button>
function getselected_civilid()
{
}
function GET_WORLD_BANK_LICN_DATA_REP() {
    debugger
    var P_ACT_ID_LIST = $('#ddl_activities').val();
    var P_LICN_COUNT = $('#txtcountlicense').val();
    var P_EXPIRY_YEAR = $('#txt_year').val();

        $.ajax({
            type: "POST",
            contentType: "application/json; charset=utf-8",
            url: "../BusinessLayer/WebMethods.asmx/GET_WORLD_BANK_LICN_DATA_REP",
            data: "{'P_ACT_ID_LIST':'" + P_ACT_ID_LIST + "','P_LICN_COUNT':'" + P_LICN_COUNT + "','P_EXPIRY_YEAR':'" + P_EXPIRY_YEAR + "'}",
            dataType: "json",
            beforeSend: function (xhr) {
                xhr.setRequestHeader("STicket", MYLIBRARY.ReturnTicket());
                Loading("????? ?????", "????????? ?? ??????? . . . ");
                $("#gvResults").empty();
            },
            success: function (Result) {
                CloseLoading();
             
                $.each(Result.d, function (key, value) {
                    if (value.Status == "1") {

                        if (value.P_LICNS_CURInfo != null) {
                            if (value.P_LICNS_CURInfo.length > 0) {

                                var rowNo = 0;
                                for (var i in value.P_LICNS_CURInfo) {

                                   
                                    if (rowNo == 0) {
                                        $("#gvResults").append("<tr class='card-info card-header text-white text-center'><th>?</th><th>??? ????? ???????</th><th>??? ???????</th><th>??? ????? ??????</th><th>?????? ????????</th><th>????????</th><th>??????</th><th>??? ?????? ??????</th><th>????????</th><th>??? ???????</th><th>???????</th><th>????? ????? ???????</th><th>???????</th><th>??? ????????</th><th>?????? ??????????</th</tr>");
                                    }
                                    var row = "<tr align='center' id='tr" + (rowNo + 1) + "' class='record'> " + "<td class='tdCount'>" +
                                        (rowNo + 1) + "</td><td>" +
                                        value.P_LICNS_CURInfo[i].comm_book_no + "</td> <td>" +
                                        value.P_LICNS_CURInfo[i].LICN_COMM_NO + "</td> <td>" +
                                        value.P_LICNS_CURInfo[i].LICN_CIVIL_ID + "</td> <td>" +
                                        value.P_LICNS_CURInfo[i].LEGAL_STRACTURE_DESC + "</td> <td>" +
                                        value.P_LICNS_CURInfo[i].ADDRESS_GOV_DESC + "</td> <td>" +
                                        value.P_LICNS_CURInfo[i].SECTOR_DESC + "</td> <td>" +


                                        value.P_LICNS_CURInfo[i].INT_ACT_CODE + "</td> <td>" +
                                        value.P_LICNS_CURInfo[i].COMP_NAME + "</td> <td>" +
                                        value.P_LICNS_CURInfo[i].ADDRESS_DESC + "</td> <td>" +
                                        value.P_LICNS_CURInfo[i].ADDRESS_AUTO_NO  + "</td> <td>" +
                                        value.P_LICNS_CURInfo[i].ADDRESS_CITY  + "</td> <td>" +
                                        value.P_LICNS_CURInfo[i].PHONE_NO  + "</td> <td>" +
                                       




                                       
                                        value.P_LICNS_CURInfo[i].MAIL + "</td>" +
                                        "<td><input type='checkbox' name='statusCheckbox' value='" + value.P_LICNS_CURInfo[i].SomeValue + "' /></td></tr>";

                                    row = $(row).hide();
                                    $('#gvResults').append($(row));
                                    rowNo++;


                                    $(row).fadeIn(1000);
                                }
                            }
                        }

                    }
                    else {

                        ModelSuccessDanger('???? !!', value.StatusDesc, '0', null);
                    }
                });
              

               
            },
            error: function (msg, status) {
                CloseLoading();
                if (status === "error") {
                    var errorMessage = $.parseJSON(msg.responseText);
                    ModelSuccessDanger('???? !!', errorMessage.Message, '0', null);
                }
            }
        });
   

}

 


Answers (1)