alfonso
Posts: 121
|
Posted: 08/23/2013, 10:08 PM |
|
I want to put, only in the last record of a grid a stile like "last" to delete right margin. For example, the result should be like this:
<div class="column one-half">
First record
</div>
<div class="column one-half">
Second record
</div>
<div class="column one-half last">
Last record
</div>
Any idea?
|
|
|
Lucius
Posts: 220
|
Posted: 08/24/2013, 1:08 PM |
|
hi,
1st - place a Label control in the grid, where "last" should show.
2nd - calculate how many records this grid has (could be done on BeforeSelect), and then on BeforeShowRow do a check if current row is last. If yes, then print-out "last" to your label.
|
|
|
alfonso
Posts: 121
|
Posted: 08/25/2013, 1:03 AM |
|
Really the grid have always the same records: 3. Could you show me an example with code?. Thanks
|
|
|
alfonso
Posts: 121
|
Posted: 08/31/2013, 1:58 AM |
|
How can I know if it is showing the second record? I imagine if I put in BeforeShow:
If actual_record=2
label.value=last"
else
label.value=""
end if
The cuestion is that I don't know how to get the value of the actual record
|
|
|
scarvello
Posts: 64
|
Posted: 08/31/2013, 5:59 PM |
|
You can use jQuery filter to select last row of a table and then apply your custom css style.
Google for "select last table row with jQuery"
|
|
|
alfonso
Posts: 121
|
Posted: 08/31/2013, 11:16 PM |
|
I see, but the question is that I don't works with tables I works with divs and lists.
I think may be solved if there a way to know it the record is 1, 2 or 3. So I create tree css styles .1, .2, .3
|
|
|
scarvello
Posts: 64
|
Posted: 09/01/2013, 12:51 AM |
|
I have not tested but I think you can also filter any last child element.
Give a look here: http://api.jquery.com/last-child-selector/
|
|
|
alfonso
Posts: 121
|
Posted: 09/02/2013, 10:50 PM |
|
That is the solution. Simply. and clear. Solved. Thanks a lot
|
|
|
JessicaRobort
Posts:
|
Posted: 09/24/2013, 2:23 AM |
|
solved
|
|
|