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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:22:26+00:00 2026-05-23T03:22:26+00:00

I want to skip 2 tr in the table with 2 different classes. first

  • 0

I want to skip 2 tr in the table with 2 different classes.

first tr with class is .gridTitleRow and 2nd tr with class is .gridSpan . How to skip these in below syntax?

$.each($(".gridTable tr:not(.gridTitleRow)"), function(a, b){});

EDITED I am using each like below

$("#gridBtn").live("click", function (e) {
    e.preventDefault();
     var indexArraay = [];
     var flag = false;
     $.each($(".gridTable tr:not(.gridTitleRow)"), function(a, b){

            var id = $("input.idField", b).val();
            var order = $("input[id='index']", b).val();
            var active = $("input[id='activeCb']", b).attr("checked");
            var deleteRow = $("input[id='deleteCb']", b).attr("checked");

            (deleteRow == true) ? flag = true : null;

            indexArraay.push({
                "id": id,
                "index": order,
                "active": active,
                "delete": deleteRow
            })
     });

    if (flag == true)
    {
        $("#dialog:ui-dialog").dialog("destroy");

        var text = "Alert: Deleting footer Prent menu will delete all submenus and assigned pages to it.";
        $('<div title="Confirmation:">' + text + '</div>').dialog({
            height: 'auto',
            width: 350,
            modal: true,
            resizable: false,
            buttons: {
                Cancel: function () {
                    $(this).dialog("close");
                },
                Confirm: function () {
                    $(this).dialog("close");
                    ProcessGrid(indexArraay);
                    ReloadGrid();
                }
            }
        });
    }else{
        ProcessGrid(indexArraay);
        //ReloadGrid();
    }

}); //End of gridBtn

Table

<script id="gridTemplate" type="text/x-jQuery-tmpl">
    <tr class="gridRow">
        <td class="gridSpan" colspan="5">${$data[0].Title}</td>
    </tr>
    {{tmpl($data) "#cellTemplate"}}
</script>
<script id="cellTemplate" type="text/x-jQuery-tmpl">
    <tr class="gridRow">
        <td class="cellTd ">
            <input type="checkbox" id="deleteCb" />
            <input type="hidden" id="Id_ + ${num}" class="idField" value="${Id}" />
        </td>
        <td class="cellTd">
            <input id="index" name="index" class="numberField" type="text" value="${IndexOrder}" />
        </td>
        <td class="cellTd">${DisplayName}</td>
        <td class="cellTd ">${UrlName}</td>
        <td class="cellTd ">
            <input type="checkbox" id="activeCb" {{if Active}} checked{{/if}} />
        </td>
    </tr>
</script>   

<span class="instructions">Only numeric value is allowed in IndexOrder textbox.</span>
<div class="gridDiv">
<table class="gridTable" cellspacing="0" cellpadding="0">
    <tbody>
        <tr class="gridTitleRow">
            <td class="iconLink width36">Delete</td>
            <td class="iconLink width60">Sort Order</td>
            <td class="iconLink widthAuto">Display Name</td>
            <td class="iconLink widthAuto">Url Name</td>
            <td class="iconLink widthAuto">Active</td>
        </tr>


    </tbody>
</table>
  • 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-23T03:22:27+00:00Added an answer on May 23, 2026 at 3:22 am
    $.each($(".gridTable tr:not(.gridTitleRow, .gridSpan)"), function(a, b){});
    

    In selectors, the “,” is like “or”. Wait – it’s like “and”, but because your selector here is in a “not()” clause, it’s “not this one and not that one”, which is like “not (this one or that one)”. I think I may belabor the point a bit 🙂

    edit — no I convinced myself it’s “or” again. Need coffee.

    edit again — a couple things:

    • There’s no reason to call “$.each()” when the first object is already a jQuery object:

      $(".gridTable tr:not(.gridTitleRow, .gridSpan)").each(function(i, elem) {
      
    • When searching by “id” value, there’s no reason to use an attribute selector, and there’s no reason to use a context because “id” values must be unique. Use “#id”:

      var order = $('#index');
      
    • Please note again that it is invalid to use the same “id” value for multiple elements on a page. If you’re using the same “id” on many table rows, that is wrong and you’ll have to change it.

    • The jQuery team has deprecated the form $(selector, base) and prefer the form $(base).find(selector). Internally, the library always performs that transformation, so you might as well save it the trouble:

      var deleteRow = $(b).find('#deleteCb');
      
    • It’s not at all clear what “flag” is supposed to do, but you may have forgotten to declare it. Maybe it’s a global variable.

    • Your comment says that “empty tr is passing with undefined”, but I do not know what that means. If the selector finds no <tr> elements, the “each” loop will simply not happen. If you describe what exactly it is that’s undefined, it might be possible to help.

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

Sidebar

Related Questions

I want to skip to the first line that contains include. <> until /include/;
Using Crystal Report 8.5 How to skip blank pages? I want to skip blank
SKIP TO UPDATE 3 I want to enable the Seam debug page on Weblogic
Want the function to sort the table by HP but if duplicate HPs then
I am retrieving 10 rown from my database but I want to skip the
I have a comma separated value table that I want to read in Python.
i have a table ' tag_article_assoc ' with [tagId,articleId] fields. i want to insert
I am making webpage where data from database are put in a table. Each
Let's say I want to build a perfect hash table for looking up an
READ FIRST I re-wrote this to make it more readable. If you want to

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.