Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ListGrid summary row scrolling and autofit issues

    (1) Horizontal Scrolling: ListGrid summary row stops scrolling before body, by the width of the vertical scrollbar. In the example below, scroll the non-frozen columns all the way to the right, then note the summary cells are misaligned horizontally with the body cells.

    (2) Autofit: Note that the summary values are truncated. (In this quick and dirty example I haven't done a real price calculation, etc., but it's sufficient to show the truncation issue.) When I set autofit on the ListGrid, the summary values are not autofit (which we require for readability).

    Code:
    isc.ListGrid.create({
        ID: "companyList",
        alternateRecordStyles:true,
        autoFetchData:true,
        dataSource:orderItemLocalDS,
        showAllRecords:true,
    
        canEdit:true, editEvent:"click",
        width:400,
        showGridSummary:true,
        showGroupSummary:false,
       autoFitFieldWidths:true,
       autoFitWidthApproach: "both",
    
        fields:[
            {name:"orderID", title:"ID",includeInRecordSummary:false, frozen:true, summaryFunction:"count"},
            {name:"itemDescription",  frozen:true},
            {name:"category", frozen:true, showGridSummary:true, 
                getGridSummary:function (records, summaryField) {
                    var seenCategories = {};
                    for (var i = 0; i < records.length; i++) {
                        seenCategories[records[i].category] = true;
                    }
                    var totalCategories = isc.getKeys(seenCategories).length;
                    return totalCategories + " Categories";
                }
            },
            {name:"shipDate",frozen:false, showGroupSummary:false, showGridSummary:false, summaryFunction:"max"},
            
            {name:"quantity", showGroupSummary:false, showGridSummary:true},
            {name:"unitPrice", showGroupSummary:false, showGridSummary:true,
             formatCellValue:function (value) {
                 if (isc.isA.Number(value)) {
                    return value.toCurrencyString("$");
                 }
                 return value;
             }
            },
            {name:"Total", type:"summary",  recordSummaryFunction:"multiplier",
             summaryFunction:"sum",
             showGridSummary:true, showGroupSummary:true,
             align:"right",
             formatCellValue:function (value) {
                 if (isc.isA.Number(value)) {
                    return value.toCurrencyString("$");
                 }
                 return value;
             }
            }
        ]
    })

    #2
    Just a quick update:

    1) We can reproduce this problem - we're looking at a fix, as well as some auto-sizing issues your test case happened to reveal.

    2) This is a good enhancement but very complicated because the summary and body are not rendered at the same time. We can put this down as a desirable feature for 3.0, but it's too disruptive to add to 2.5.x.

    Comment


      #3
      We've resolved issue #1 in both mainline (the 8.x, or for SGWT users 3.x branch) and the SC 8.1 / SGWT 2.5 branch
      The fix will be present in nightly builds going forward

      Comment


        #4
        I have tried the latest build (SmartClient_SC_SNAPSHOT-2011-11-27_PowerEdition.zip) and issue #1 is fixed. Thanks for that.

        Below are 3 more issues in the same vein. Refer to the example code and screenshots below that I used to replace the Grids | Appearance | Header Spans example in your Feature Explorer.

        (3) When the listgrid below is first shown, the Capital column is extra wide even though autofitFieldWidths is set to true. See screenshot autofit_issue.png. Manually performing an AutoFit All Columns from any column header menu reduces the Capital column to autofitted width.

        (4) Expand the Population column so that a horizontal scrollbar shows. Select the Country header menu's | Autofit All Columns. Listgrid fields are autofitted and summary row columns are aligned. Repeat the same Population column resize + Country's autofit all columns. Summary row values are misaligned. See screenshot summary_row_misalignment.png.

        (5) Expand the Population (or any non-frozen) column so that a horizontal scrollbar shows. Scroll all the way to the right. Drop down the column header menu of the Country column (which is frozen). The wrong menu shows, as it has a "Group by Capital" menu item. See screenshot wrong_column_header_menu.jpg.

        Code:
        isc.ListGrid.create({
            ID:"countryList",
            alternateRecordStyles:true,
            headerHeight: 40,
            dataSource: countryDS,
            autoFetchData: true,
            showGridSummary: true,
            autoFitFieldWidths:true,
            fields:[
                {name:"countryCode", frozen:true, title:"Flag", width:50, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png"},
                {name:"countryName", frozen:true, title:"Country"},
                {name:"capital"},
                {name:"independence", title:"Nationhood"},
                {name:"population", title:"Population", formatCellValue:"isc.Format.toUSString(value)"},
                {name:"area", title:"Area (kmē)", formatCellValue:"isc.Format.toUSString(value)"},
                {name:"gdp", formatCellValue:"isc.Format.toUSString(value)"}
            ],
            headerSpans: [
                {
                    fields: ["capital","independence"], 
                    title: "Government & Politics"
                },
                {
                    fields: ["population", "area", "gdp"], 
                    title: "Demographics"
                }
            ]
            
        });
        isc.Window.create({
          ID:"testWin",
          items:["countryList"],
            width:750, height:224
        });
        Attached Files

        Comment


          #5
          (3) When the listgrid below is first shown, the Capital column is extra wide even though autofitFieldWidths is set to true. See screenshot autofit_issue.png. Manually performing an AutoFit All Columns from any column header menu reduces the Capital column to autofitted width.
          That's not a bug, it's a feature! Set autoFitFieldsFillViewport:false to disable it.

          (4) Expand the Population column so that a horizontal scrollbar shows. Select the Country header menu's | Autofit All Columns. Listgrid fields are autofitted and summary row columns are aligned. Repeat the same Population column resize + Country's autofit all columns. Summary row values are misaligned. See screenshot summary_row_misalignment.png.
          We're not reproducing this against the latest (8.1 branch) code. It could possibly be some obscure native browser bug we're encountering - what browser/OS are you getting this behavior on?

          (5) Expand the Population (or any non-frozen) column so that a horizontal scrollbar shows. Scroll all the way to the right. Drop down the column header menu of the Country column (which is frozen). The wrong menu shows, as it has a "Group by Capital" menu item. See screenshot wrong_column_header_menu.jpg.
          We see this one and will let you know when we have a resolution

          Comment


            #6
            Quote:
            (4) Expand the Population column so that a horizontal scrollbar shows. Select the Country header menu's | Autofit All Columns. Listgrid fields are autofitted and summary row columns are aligned. Repeat the same Population column resize + Country's autofit all columns. Summary row values are misaligned. See screenshot summary_row_misalignment.png.


            We're not reproducing this against the latest (8.1 branch) code. It could possibly be some obscure native browser bug we're encountering - what browser/OS are you getting this behavior on?
            I have just successfully reproduced this against 2011-11-27 nightly on:
            WinXPsp2 / Firefox 8
            Win7 / IE8
            Win7 / Chrome 6
            WindowsServer2008sp1 / IE7

            My steps:
            - Paste my test case on the Grids | Appearance | Header Spans and Try it
            - Resize the extra wide Capital column to the right so that half of Nationhood is obscured by the sorter button at the right edge of the list grid column header (only "Natio" shows).
            - Drop down Country menu and Auto Fit All Columns. No problem.
            - Resize the extra wide Capital column to the right so that half of Nationhood is obscured by the sorter button at the right edge of the list grid column header (only "Natio" shows).
            - Drop down Country menu and Auto Fit All Columns. Summary row is misaligned.

            Note that this bug doesn't not occur if I put the autoFitFieldsFillViewport:false (thanks for the tip!) into the listgrid, which is good enough for me!

            Comment


              #7
              #5 is now resolved.
              We'll take another look at #4 and update this thread when its resolved (though happy to hear you have a working solution on this for now)

              Comment


                #8
                Originally posted by Isomorphic
                2) This is a good enhancement but very complicated because the summary and body are not rendered at the same time. We can put this down as a desirable feature for 3.0, but it's too disruptive to add to 2.5.x.
                any update on #2 ? I just hit it in SmartClient_SC_SNAPSHOT-2012-01-26_v82p
                reproducible ny adding autoFitData:"horizontal" in #multiLineSummaries sample

                Comment


                  #9
                  I'd like this too (#2 - AutoFit for summary titles) ... Any progress on that particular aspect ?

                  Thanks,

                  Comment


                    #10
                    We have someone who is considering sponsoring it. The best way to move it along is to write to us on the Contact page and indicate that you would co-sponsor up to X dollar amount, then we'll contact you if we have enough such sponsors.

                    Comment


                      #11
                      Ok. Thanks,

                      In the meantime, is there a way to have my listGrid still use autoFit strategies but force a specific width on some
                      of the columns ?

                      Thanks,

                      Comment


                        #12
                        When you set a width with autoFit enabled, it acts as a minimum - will that work?

                        Comment


                          #13
                          Yes. It does. I just tested it and I'll be able to live with that for now. Thanks for your insight!

                          Comment

                          Working...
                          X