joec2000

Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • in reply to: Bug in averaging function for footers? #101451
    joec2000
    Participant

    Yeah, that's why I was saying I think it could go either way.

    As long as everything else works OK, the programmer can always “tweak” the values of the cells to get the grid to behave the way they want.

    Thanks for fixing it so quickly!

    – Joe

    in reply to: Bug in averaging function for footers? #101437
    joec2000
    Participant

    Hi Tony,

    Actually, after I posted my solution, I realized I wrote a custom formatter for percentages that was inserting the single space. Can't remember why exactly as it seemed to perform the same way when I took the single space out. Maybe it was a typo on my part.

    I would think that if the cell value is null or, when the white space is trimmed, equals empty string, then the cell's value should not count towards the average.

    At the very least, I think that null and empty string should not count – I think you could make a case either way about the trimming of whitespace.

    Thanks!

    – Joe

    in reply to: Bug in averaging function for footers? #101432
    joec2000
    Participant

    For anyone else that is having these problems, here's a revised “if” block with only a few minor changes.

    NOTE: I did NOT thoroughly test this yet but it solved the problems I was encountering.

    in reply to: Bug in averaging function for footers? #101431
    joec2000
    Participant

    Just found another problem with the averaging function. Same 30 rows, different column containing percentages. 7 of the 30 cells in this column are blank (see screenshot below where “v” is ” ” – presumably not truly blank so the browser styles the cell correctly). Because of the ” ” is not a number and fails parseFloat(), JQGrid calculates the average as “NaN”.

Viewing 4 replies - 1 through 4 (of 4 total)

Stay connected with us in your favorite flavor!