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 9024587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:03:18+00:00 2026-06-16T06:03:18+00:00

I have an existing function, which takes a cellobj as input parameter e.g. MyFunction(cellObj)

  • 0

I have an existing function, which takes a cellobj as input parameter e.g.

MyFunction(cellObj)

This is used when somebody clicks on a cell in a table, and the HTML in the table will look like this:

MyFunction(this)   //this is the cellObj

Now I need to call the exact same function, but I am not in the table, I am looping through the rows
and I cant pass “this”, as it is a row object and not a cell object.
My question thus is how to get the cellobject from a rowobject please

e.g.

 $("#gv tr:has(td)").each(function () {
      var cellObj = $(this)........
      MyFunction(cellObj);
})
  • 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-16T06:03:20+00:00Added an answer on June 16, 2026 at 6:03 am

    So you’re in the row, and you need to get each of the cells in turn to pass them to your function, so all you have to do is find the cells from the row, and loop through them, in exactly the same way you did to get and loop through the rows of your table.

    This should do the trick:

    $(this).find('td').each(function() {
      // now your cell is in $(this)
      MyFunction($(this));
    });
    

    Use that instead of var cellObj = $(this)... etc.

    Edit:

    To execute it only once per row, try…

    var cellObj = $(this).find('td:first');
    MyFunction(cellObj);
    

    Though I feel that if you are doing it this way, that maybe your code is not structured efficiently. I would put the line that finds the cellObj inside your function, and pass your function each row instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this existing Timer function: final Timer waveTimer = new Timer() { @Override
I have converted this existing C# .NET 2.0 code (which appears to take in
The background: I have a function which takes some parameters. I want to have
In R, I have a function which takes the name of another function as
In Guava, if I have a Collection<T> - is there any existing function in
I have existing Linux shared object file (shared library) which has been stripped. I
I have existing code with their own makefiles which I want to load into
I have an Edit Form page which edits existing posts. i wanted to put
I have an existing mobile web site on which I would like my users
I'm trying to modify some existing JavaScript code which used apply() to pass an

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.