Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Apr 2009
    Location
    Kuwait
    Posts
    17

    Alternate Row coloring

    Hi All,

    I am using DynaMetapush table with one row template.How can i have alternate coloring for the rows added to the table?Since i am having one row template i can only provide the style for that row ..which gets repeated.

    Regards,
    George Eapen

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,090
    The problem with DynaMetapush tables is also that rows can shift, because of insertions or deletions; in that case, the DOM element containing the row values does not change, so it should change its color according to the new position.
    You can see this thread, where only unchecked suggestions are provided.
    To add one more, if your needs only involve the row background, maybe it is possible to define transparent template rows over an alternate background.

  3. #3
    Member
    Join Date
    Apr 2009
    Location
    Kuwait
    Posts
    17
    I checked the thread http://www.lightstreamer.com/vb/show...light=altering.
    "In example you could store the dom references given by the onChangingValues and change the rows colors on the basis of the data you receive, or you could try even and odd rules as shown here (note that I'm not sure this would work as I have no time to test it at the moment, btw if you can give it a try please let us know your results)"

    In the excerpt above of the thread 2 approaches are specified for alternate coloring.I tried the second odd and even coloring using css but unfortunately its not supported in IE/firefox.
    Can u explain how the first approach using DOM reference can be accomplished .

  4. #4
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hi,

    thinking about it I'm not sure it is feasible as the "change color to your rows" approach involves a main problem whenever two rows have the same value on the sorted column and you couldn't know which one is shown on top by our sorting algorithm.

    Btw such approach consist on tracking the position of each row knowing the sort field and the sort values. Having such information you should store somewhere the DOM references to each row that is given through the onChangingValues callback and then change row colors accordingly. As said in the other post it's a little bit tricky.

    Btw, I think that Dario's advice was the best one: you could use fixed height rows with no background and a background image to obtain the alternate rows.
    You can see an example of a table with a background on our homepage

    HTH

  5. #5
    Member
    Join Date
    Apr 2009
    Location
    Kuwait
    Posts
    17
    ok..i wil do it with bg image..thank you very much.

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 11:55 AM.