简体   繁体   中英

Button click event fires only once

This is the custom button column definition in the qxgrid

{ text: 'Actions', cellsrenderer: function (row, column, value) 
 {
    var viewType = $("#divManageViewGrid").jqxGrid('getcellvalue', row, 'VIEW_TYPE');
     if (viewType == "Shared") {
       return '<input type="button" class="button-link" id="btnRemove" value="Remove"/>';
                         }
    return '<input type="button" class="button-link-delete"  value="Delete"/>';
               }
        } column definition

This is the button click event which fires only once

 $(document).on(‘click’, “.button-link”, function () 
 {
   //open popup
    var row = $(“#divManageViewGrid”).jqxGrid(‘getselectedrowindex’);
    id = $(“#divManageViewGrid”).jqxGrid(‘getrowid’, row);
    $("#popupWindow").jqxWindow('show');
  });

the button click event fires only once can any one help me on this even though i have used "on"

I haven't seen your HTML but may be the following step can resolve your problem:

Make sure that at any point of time you don't have two controls(Dynamically generated) with same ID in your DOM(Document object model, including your popup html). This can really cause a problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM