Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6680721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:30:29+00:00 2026-05-26T04:30:29+00:00

I am trying to remove a TR in a table view. when I hit

  • 0

I am trying to remove a TR in a table view. when I hit delete.

However I am having issue doing this.

$("#deletelead").live('click', function(event){
    deleteid = $("tbody td.small input:checkbox:checked").map(function(i, el) { return $(el).attr("id"); }).get();
    $("tr").remove().before("input:checkbox:checked").map(function(i, el) { return $(el).attr("id"); }).get();
    //alert(deleteid.length);   

    $.each(deleteid, function(index, value) { 




    $.ajax({
                type: "POST",
                url: "system/classes/core.php",
                data: "task=deletelead&customerid="+deleteid,
                success: function(data){
                    if((data) == 1)
                    {
                        //loadadminlayout();
                    }
                    else
                    {
                    alert(data);    
                    }
                }
            });
    return false;

    });
});

jQuery code that creates the table

function listallleads(){


    var script = document.createElement('link');
    script.href = 'theme/style/manageleads.css';
    script.rel  = 'stylesheet';
    script.type = 'text/css';
    document.getElementsByTagName('head')[0].appendChild(script);

    if ($.browser.msie && $.browser.version == 8) {
        var script = document.createElement('link');
        script.href = 'theme/style/ie-manageleads.css';
        script.rel  = 'stylesheet';
        script.type = 'text/css';
        document.getElementsByTagName('head')[0].appendChild(script);
    }



    $.getJSON(URLLINK, function(dataleads) {

      $.each(dataleads,function(i, myleads){
        var businessname = "";
        if(myleads.Company == null || myleads.Company == "null" || myleads.Company == "")
        {
        businessname = myleads.TradingName; 
        }
        else
        {
        businessname = myleads.Company;
        }

        if(usertype == 3)
        {
            if(myleads.AMStatus == 1)
            {
            leadstatus = "All Confirmed";   
            }
            else 
            {
            leadstatus = "Not Confirmed";   
            }

        }
        else 
        {
            leadstatus = leadstatusselect(myleads.LeadStatus);
        }

        if(myleads.AMStatus == 1)
        {
            myleads.AMStatus = "one";
        }



        cssstats = "lead"+myleads.AMStatus



            $("tbody").append('<tr id="'+myleads.customer_id+' class="'+cssstats+'">'+
'           <td id="row" class="small"><input id="'+myleads.customer_id+'" type="checkbox"></td>'+
'           <td>'+myleads.CreatedTime+'</td>'+
'           <td>'+businessname+'</td>'+
'           <td class="center">'+myleads.FirstName+' '+myleads.LastName+'</td>'+
'           <td class="center">'+myleads.Phone+'</td>'+
'           <td class="center bigger">'+myleads.Email+'</td>'+
'           <td class="center">'+myleads.stafffirstname+' '+myleads.stafflastname+'</td>'+
'           <td class="center last">'+leadstatus+'</td>'+
'       </tr>');
      });
        qs.cache();
    });

    if(usertype == 3)
    {
    leadtype = "A/M Status";    
    }
    else
    {
    leadtype = "Lead Status";   
    }

    $("#todo_bg").hide();
    $("#menuarea").html('<a id="gotohome"><div id="backmain" class="backbg">Back</div></a><div id="nav" class="backbgright">Manage Business Lead</div>'+
                        '<div id="dowithleads"><button id="editlisting" class="blackbutton manage">Edit Listing</button><button id="sendemailout" class="blackbutton manage">Send Message</button> <button id="deletelead" class="blackbutton manage">Delete Lead</button>'+
                        '<div id="searchbox"><form action="#"><fieldset><input type="text" name="search" value="" id="searchleads" placeholder="Search" autofocus /></fieldset></form></div>'+
                        '</div>'+
                        '<div id="dowithleads"><table cellpadding="0" cellspacing="0" border="0" class="sortable paginated scrollTable" id="manageleads">'+
'   <thead class="fixedHeader">'+
'       <tr>'+
'           <th class="small" id="first"><input type="checkbox" class="checkbox checkall" value="Yes"></th>'+
'           <th class="sort-alpha">Created Time</th>'+
'           <th class="sort-alpha">Company</th>'+
'           <th class="sort-alpha">Lead Name</th>'+
'           <th class="sort-alpha">Phone No.</th>'+
'           <th class="sort-alpha bigger">Email</th>'+
'           <th class="sort-alpha">Lead Owner</th>'+
'           <th class="sort-alpha last">'+leadtype+'</th>'+
'       </tr>'+
'   </thead>'+
'   <tbody class="scrollContent"></tbody>'+
'</table></div>');  


    setTimeout(function(){
    var script = document.createElement('script');
    script.src = 'js/table.js';
    script.type = 'text/javascript';
    document.getElementsByTagName('head')[0].appendChild(script); 
    stripedTable();
    },2000);


    var qs = $('input#searchleads').quicksearch('table#manageleads tbody tr');
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:30:30+00:00Added an answer on May 26, 2026 at 4:30 am
     $('tbody tr').each(function(){
                    if ($(this).find('input:checkbox:checked').length == 1) {
                         $(this).remove();
                    }
              });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting this error when trying to delete a row out of a
I am trying to learn ASP.NET MVC and I hit this problem: I have
I am trying to make a table view that should be half editable and
I have a table that I am trying to dynamically delete rows from. Each
I was trying to remove all the lines of a file except the last
I am trying to remove a pending changelist in perforce. All the files (20
I'm trying to remove some items of a dict based on their key, here
I'm trying to remove a color from a picture imported (JPG) in Flash CS4
I'm trying to remove all but the first child component from a Java Container.
I'm trying to remove a class attribute from an element and add the class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.