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

  • SEARCH
  • Home
  • 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 8504083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:55:44+00:00 2026-06-11T01:55:44+00:00

I am having trouble selecting a row of a table from a link within

  • 0

I am having trouble selecting a row of a table from a link within the row. When the link is clicked I need the row to disappear. My current code is as follows…

function show_docs(){
$('.file_holder5').html("");
var id=$('.useri').val();
var data="user_id="+id;
$.ajax({
    type:"POST",
    url:"admin_includes/get_all_files.php",
    data:data,
    success:function(html){

        var split_html=html.split("*^*");
        var split_ht_count=split_html.length-1;
        var tb2="<table class='doc_table' width='100%'>";
        tb2+="<tr><th>Upload Date</th><th>File</th><th>Description</th><th>Actions</th><th>&nbsp;</th></tr>";
        var el;
        if(split_ht_count==0)
        {
            tb2+="</table>";
            tb2+="<p>There are currently no files in your library.</p>";
        }
        else
        {
        for(var rx=0;rx<split_ht_count;rx++)
        {
            el=split_html[rx].split("|");
            tb2+="<tr class='file_row' data-link2='"+el[0]+"'><td>"+el[2]+"</td><td>"+el[1]+"</td><td>"+el[3]+"</td><td><a class='view_f' href='sym.php?doc_id="+el[0]+"'>View File</a></td><td><a class='del_f' href='javascript:void(0)' data-link='"+el[0]+"'>Delete File</a></td></tr>";

        }
        tb2+="</table>";
        }//end else
        $(tb2).appendTo('.file_holder5');
        StripeRows();
    }
});//end ajax
}
//-----------------delete_files---------------------
$(document).on('click', '.del_f', function(){
var file_id=$(this).data('link');
var data="file_id="+file_id+"&user="+$('.useri').val();

$.ajax({
    type:"POST",
    url:"admin_includes/delete_filex.php",
    data:data,
    context:this,
    success:function(html){
        if(html=="1")
        {
            alert("The selected file is needed for a current job. To delete this file, delete the file from the current appointment in the Current Jobs page.");
            return;
        }
        else
        {
            //get rid of listing
            $('tr.file_row').data('link2', file_id).remove();
        }
    }
});//end ajax
 });

Obviously it is my method of selecting the current row that is causing me problems.

  • 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-06-11T01:55:45+00:00Added an answer on June 11, 2026 at 1:55 am

    Try this code when you try remove the row:

    $(this).closest("tr").remove();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having major trouble selecting the most current/matching row in my database. For
I am having trouble efficiently selecting the information I need to display. Hopefully someone
Having trouble with each function... Will try to explain by example... In my code,
I am having trouble selecting an item from a Javascript dropdown (i.e. the items
I'm having trouble selecting the input value from this html: <li class=t-item> <div class=t-mid>
I'm having bit of a trouble selecting correct values from my mysql sql server.
I'm having trouble selecting the right element with my jQuery code. This is what
I'm having trouble selecting items from a list of domain objects based on a
I'm having trouble with updating final_id by selecting the highest final_id already in table
I'm having trouble selecting a list that is mixed with javascript. The original code

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.