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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:37:19+00:00 2026-05-29T05:37:19+00:00

i am using datagrids in struts2, i have almost done the integration and now

  • 0

i am using datagrids in struts2, i have almost done the integration and now i want to insert different classess in the alternate rows in the listing.

Here is my script

 <sjg:grid
        id="gridtable"
        dataType="json"
        href="%{remoteurl}"
        pager="true"
        gridModel="cityList"        
        rowNum="%{rows}"
        rownumbers="true"  
        altRows ="true"
        altClass = "even"


    >
        <sjg:gridColumn  name="id" index="id" title="ID" formatter="integer" sortable="true"/>
        <sjg:gridColumn name="name" index="name" title="Name" sortable="true"/>
        <sjg:gridColumn name="state_Code" index="state_Code" title="state_Code" sortable="true"/>

    </sjg:grid>

I have set the option

altRows ="true"
altClass = "even"

it generate the class even in all even rows. But i also want to insert odd class in odd rows. How it could be possible?

  • 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-29T05:37:20+00:00Added an answer on May 29, 2026 at 5:37 am

    Use the underlying jquery datagrid directly found here: http://www.trirand.com/blog/

    Figure out how to use the struts2-json-plugin for ajax and you’ll be miles ahead.

    As a web programmer you must know JS.

    That aside… You are aware that you have set “altClass” but you never set “cssClass” that could be an issue? Consult the documentation on this tag library here: http://code.google.com/p/struts2-jquery/wiki/GridTag#Using_Tags_to_render_the_Grid

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

Sidebar

Related Questions

Using VB.Net I want to get a all datagrid cell values, then insert into
I'm using a DataPager control in my silverlight application. I have different pagers for
I have two datagrids side by side bound to different data tables and each
I'm using DataGrid with AutoGenerateColumns=True. Now in addition to auto-generated columns I want to
I have been using a number of commercial WPF datagrids in the past and
I have a button inside the DataGrid using ItemRenderer I want to access the
I'm using datagrids a lot for varying amounts of data, so have set autoHeight:
I have a Silverlight application that is using a DataGrid. Inside of that DataGrid
We have custom headers in the Silverlight DataGrid using the ContentTemplate. We've got a
I need to generate a datagrid using a Struts 2, i have found out

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.