• Resolved gamattox

    (@gamattox)


    Hi Tobias,

    I’ve been using the “.tablepress .even td” and “.tablepress .odd td”, functionality as described in the documentation but am having no luck getting it to work the way I need.

    I am trying to use the above code to determine if an EVEN numbered row was selected and is so then index to the NEXT ODD ROW and execute some custom code against that row.

    I am able to identify which row is selected but cannot determine if it is an even row or an odd row so I can index one row and run my custom code. Do you have a code snippet to do something like below?

    If (odd row selected ){
    index to next row;
    execute my code here;
    }

    Thx,
    Gary

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    I’m not sure that I understand. From what I understand, you are trying to develop JavaScript code for a functionality here? Or CSS code for styling?
    And what do you mean with “selected”? Do you have form elements like checkbox on the rows?

    Regards,
    Tobias

    Thread Starter gamattox

    (@gamattox)

    Hi,

    Javascript/JQuery.

    My goal is to use the content residing in any odd numbered row in a specific column as a parameter to my function. My code is correctly returning the data in the row and column I need when I select any ODD row in the table. When I click on any EVEN row I need to programatically index to the next ODD row to pickup the data in the column from that row since the EVEN rows do not contain the data needed for the function.

    Said another way, when I click on a row and detect a currentRow that is EVEN, I need to add “1” to that row number and then use the newly assigned odd row number in my code.

    Thanks,
    Gary

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi Gary,

    to be honest, I still don’t really understand. If you have a currentRow variable, you could check whether that is an even number, and if not just add 1 to it, couldn’t you?

    Can you maybe share the code that you have already, or a link to the page with the table?

    Regards,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Index to next row’ is closed to new replies.