title: Jquery click event with popup
body: <p>i have following code and its not working properly,basically i am willing to add popup on my click event for confirm delete but when i click deleting the  row first and then apppear popup,i am stuck and coudn't understand whats going,here is my code</p>
  
  <pre><code>$.fn.matrix.deleteCategory = function ( jqObj ) {
  
       jqObj.find("#award").on('click', ".categoryminus", function () {
  
  
  
          var CategoryClass = $(this).closest('tr').attr('class'); // table row Class 
           //split all class of current table row
          var CategoryArray = CategoryClass.split(' ');
           //delete all rows having class like C-1-o-1
          var categoryClassLike        = '[class^=' + CategoryArray[0] + '-o-]';
  
           //for rTenderDocument,check delete c-2,c-3 and appear popup
           if ( formType == 'rTenderDocument') {
  
              if ( CategoryArray[0] == 'C-2' ){
  
                  $('#priceConfirm').bPopup();
  
                  $('.priceConfirm').click(function(){
  
                      if($(this).attr('id') == 'priceDeleteNo'){
                          $('#priceConfirm').bPopup().close(); 
                          return false;
  
                       } else {
                          $('#priceConfirm').bPopup().close();
                          return true;
  
                       }
                  }); 
              } else if ( CategoryArray[0] == 'C-3' ){
  
                  $('#fixedAnnualConfirm').bPopup();
  
                  $('.fixedAnnualConfirm').click(function(){
  
                      if($(this).attr('id') == 'fixedAnnualDeleteNo'){
                          $('#fixedAnnualConfirm').bPopup().close(); 
                          return false;
  
                       } else {
                          $('#fixedAnnualConfirm').bPopup().close();
                          return true;
  
                       }
                  }); 
              }
  
           }  
  
           //remove all child of sub category
           $( categoryClassLike ).each(function(){
  
               var obj              = $(this);
  
               var subCategoryClass = obj.closest('tr').attr('class'); // table row Class 
               //split all class of current table row
               var subCategoryArray = subCategoryClass.split(' ');
               //delete all rows having class like C-1-o-3-So-1
               var classLike        = '[class^=' + subCategoryArray[0] + '-So-]';
  
              //remove all child of sub category
               $( classLike ).each(function(){
                   $(this).remove();
               });
  
               //remove sub category
                obj.remove();
           });
  
            //after removing child then delete their parent
            $(this).closest('tr').remove();
  
       });
  
       return jqObj;
     };
  </code></pre>