ste/ste_script.js
/**
 * Open the delete category popup
 *
 * @param id
 */
Open the delete category popup
@param id
Open the delete category popup @param id
function delete_cat(id) {
  if ($('#ste').val() < 1) {
    alert("Please select an ST&E");
    return;
  }
  if (!confirm("Are you sure you want to delete this category?  Currently assigned targets will be set to the 'Unassigned' category.")) {
    return;
  }
  $.ajax('/ajax.php', {
    data: {
      action: 'delete-cat',
      ste_id: $('#ste').val(),
      cat_id: id
    },
    success: function (data) {
      if (data.error) {
        alert(data.error);
      }
      else {
        location.reload();
      }
    },
    error: function (xhr, status, error) {
      console.error(error);
    },
    dataType: 'json',
    method: 'post',
    timeout: 3000
  });
}
function delete_cat ( id ) { if ( $ ( '#ste' ) . val ( ) < 1 ) { alert ( "Please select an ST&E" ) ; return ; } if ( ! confirm ( "Are you sure you want to delete this category?  Currently assigned targets will be set to the 'Unassigned' category." ) ) { return ; } $ . ajax ( '/ajax.php' , { data : { action : 'delete-cat' , ste_id : $ ( '#ste' ) . val ( ) , cat_id : id } , success : function ( data ) { if ( data . error ) { alert ( data . error ) ; } else { location . reload ( ) ; } } , error : function ( xhr , status , error ) { console . error ( error ) ; } , dataType : 'json' , method : 'post' , timeout : 3000 } ) ; }
Open the delete category popup
 @param id
Open the delete category popup @param id