• Totals in views fixed

    By Jonathan Roberts 2 decades ago

    I've had a stab at getting the totals working in views and seem to have been successful. I'm not a Javascript Dev so its probably a bit of a hack but from my limited testing it appears to work.



    Would you be interested in the code and if so where do I send them?



    Thanks

    • re: updates

      By jason a thomas 2 decades ago

      I'm sure your code could be integrated into the project. However, I am currently unable to find time for enhancing this project any further. I am looking for someone to take over as project chef.

      Interested?

      • By Jonathan Roberts 2 decades ago

        Its tempting but I'm no where near technically competent enough to take this on.

        I've only been web developing for a short while, and although I can muddle through the javascript and generating the html I'm totally lost on the xml part.



        anyway I've sent you the updated code just in case.

    • fixed code

      By Jonathan Roberts 2 decades ago

      for anyone wishing to use totals in their views I've placed the modified javascript file in the code bin until its part of the project. Look under code bin - by date - 11/05/2007 - NotesView2 fixed totals js file



      Although I've tested this in my application I make no promises that it will work in with all existing functionality.



      Thanks

      • Added to upcoming release

        By Jeremy G Hodge 2 decades ago

        Hey Johnathan …



        Thanks for the post on the code. I've started working on a new release and have integrated this into that.



        Fwiw, your code wasn't a hack at all. Without an extensive amount of testing so far, your code works well. I've integrated your findSpanLength into the NotesView2 object instead of letting it float out on its own, and the only bug i've identified so far is that for columns that have multiple categories with in a single column (ie the categorized column's formula is [ Value1 + "\" + Value2 ]) the indent was insufficient to distinguish the subcategory from the parent category. Restoring the line:



        if(entry.indent)td.style.paddingLeft = (parseInt(entry.indent) * 1) + "px";



        to



        if(entry.indent)td.style.paddingLeft = (parseInt(entry.indent) * 15) + "px";



        resolves the issue. (I think it was either an accidental deletion, or you were trying to prevent the column total from being padding 15px, however that line is never called for the total column b/c of the twistieSwitch var, so no worries.



        Thanks again.