It would sure be nice if we can have a count of the number of items that were sorted or filtered when listing assets! (Its hard to count 62 head of cattle by scrolling the page.)

Or the count could be at the beginning of the list, depending on how the code is set up.

Comments

BruceDawson created an issue. See original summary.

m.stenta’s picture

Component: Farm Animals » Farm Assets

Yea that would be nice. Not hard to add either... Views has a "View row counter" field that can be added as a column.

I'll add this to the beta16 plan. Next time I'm working on Views I can add this.

Should we add it to Views of logs as well? Or just assets?

m.stenta’s picture

Title: Have a count at end of filtered list » Add row counter to asset lists
BruceDawson’s picture

I dunno about views of logs. I don't think I have a need for that, but I
can think of some usage senarios that some might want it for; so
might as well add it there too.

Or you can add a "provide count" checkbox to the filtering. :-)

m.stenta’s picture

Yea there could be some use-cases. Ie: How many times did I harvest lettuce this year?

Or you can add a "provide count" checkbox to the filtering. :-)

I don't know if there's an easy way to do that... but I think just adding the column would be fine. It won't take up much real estate.

m.stenta’s picture

Version: 7.x-1.0-beta15 » 7.x-1.x-dev

This slipped between the cracks but I'm working on it now...

m.stenta’s picture

Title: Add row counter to asset lists » Add row counter to asset/log lists

Changing the title because it will also be added to log lists.

m.stenta’s picture

Ok, so after looking at this, I think I'm going to change my plan slightly, and instead take the alternative approach @BruceDawson proposed in the description:

Or the count could be at the beginning of the list, depending on how the code is set up.

Views has a "Result summary" that can be added to the View's Header or Footer, which adds the following: "Displaying @start - @end of @total"

If the goal is simply to have a count of the records returned by the current filter, then that seems to be the best way to accomplish it. Adding a new column with a row counter is also possible, but brings some other baggage/considerations with it (will it be confused with "Asset ID"? should it count up or down? how does it play into CSV export/import, if at all?). So I'm just going to take the simpler approach, and avoid those questions altogether.

I'm going to add it to the View Footer, so that it appears between the pager and the CSV download icon (I'll also center it, and the CSV icon, so it looks nice under the pager).

  • m.stenta committed e1adae3 on 7.x-1.x
    Issue #2907879: Add row counter to asset/log lists
    
m.stenta’s picture

Status: Active » Fixed

Done!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.