Announcement

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

    [bug] canRemoveRecords and auto fit all columns

    SC_SNAPSHOT-2012-02-03_v8.2p/PowerEdition
    Chrome, FF10 (see attachment ff10.jpg for resulting view with FF10)

    if you put canRemoveRecords:true in a grid without fixed columns width, as in http://www.smartclient.com/index.jsp#columnOrder, doing a "auto fit all columns" via header context menu makes the "removeField" disappear in the rows, and very large in the header. The remove icon will appear doing a manual resize of the removeField.

    in IE8 the behaviour is different, but also not correct (see attachment ie8.jpg)
    Attached Files
    Last edited by claudiobosticco; 12 Feb 2012, 09:03.

    #2
    others bugs (FF & Chrome):

    1. with canRemoveRecords:true on a grouped grid, when clicking on the "group header" row at the "removeField" position, a removeData is triggered.

    2. (maybe related to previous post) Modify sample http://www.smartclient.com/index.jsp#gridHeaderSummary like this:
    Code:
    isc.ListGrid.create({
        ID: "companyList",
        width:600, height:520,
        alternateRecordStyles:true,
        autoFetchData:true,
        dataSource:orderItemLocalDS,
        showAllRecords:true,
        groupByField:"category", groupStartOpen:"all",
        canEdit:true, editEvent:"click",
        canRemoveRecords:true,
        showGridSummary:true,
        fields:[
    {isRemoveField:true,frozen:true},
            {name:"orderID", includeInRecordSummary:false, summaryFunction:"count"},
            {name:"itemDescription"},
            {name:"category",  showGridSummary:true, showIf:"false",
                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";
                    
                },
                summaryFunction: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", showGroupSummary:true, showGridSummary:false, summaryFunction:"max"},
            
            {name:"quantity", showGroupSummary:false, showGridSummary:false},
            {name:"unitPrice", showGroupSummary:false, showGridSummary:false,
                formatCellValue : function (value, record, rowNum, colNum, grid) {
                    if (record == null || record._isGroup) {
                	    return "&nbsp;";
                    } else {
                        return '$'+isc.Format.toUSString(value, 2);
                    }
                }
            },
            {name:"Total", type:"summary", recordSummaryFunction:"multiplier",
             summaryFunction:"sum",
             showGridSummary:true, showGroupSummary:true,
             align:"right",
             formatCellValue: "'$'+isc.Format.toUSString(value, 2)"
            }
        ]
    })
    (btw original sample has an extra comma after last field definition)
    as you can see, the remove icon is in the same field of the category description (you can resize the field to see its text, see attachments ff10.jpg and ff10-resized.jpg)
    and clicking on the +/- icon to expand/collapse a group triggers a remove.

    but if you try adding
    Code:
    showGroupSummary:true, 
    showGroupSummaryInHeader:true
    then the appearance changes, and after a column resize it gets correct. Or at least it gets the appearance which I'm thinking it's the right one (see ff10_withGroupSummary.jpg and ff10_withGroupSummary_correctAfterResize.jpg ).
    Attached Files
    Last edited by claudiobosticco; 22 Feb 2012, 14:14.

    Comment


      #3
      any updates on these issues?

      as of SNAPSHOT-2012-02-14_v82p are still there.
      Last edited by claudiobosticco; 15 Feb 2012, 05:32.

      Comment


        #4
        SmartClient Version: v8.2p_2012-06-04/PowerEdition, still there

        Comment


          #5
          To break this down by issue:

          1) When running autoSize logic on the remove field (for example via the "auto fit all columns" menu item), the field appears to disappear and lead to odd behavior.
          This was a logic bug. It's now resolved in both the 8.2p and 8.3d branches (check the next nightly build for the change)

          2) When showing the remove column (canRemoveRecords:true) and grouping, clicking on the group header node inside the remove column behaved badly, seemingly attempting to apply "remove" behavior to the group node.
          Also a logic bug - now resolved (both branches).

          3) When you have a grid with the "canRemoveRecords" attribute set, and the remove field is frozen, but all other fields are unfrozen, the group titles appears to get cut off unless you drag resize the remove field to be wide enough to accomodate it. Slightly different behavior occurs when showing group summaries in the group header nodes.

          By default the group title will show in a row that spans the body of a listGrid rather than rendering into a single column, so it will not be truncated by the width of a field.
          However once you introduce frozen fields this is not possible - in this mode the frozen body and the unfrozen body are two different components, so the group title can span the width of all frozen fields, but can't span both components. As a result if you have a single, small frozen field the title will be truncated.
          There isn't really a way around this limitation per se but we do have some properties that can ameliorate the effect.

          One option would be to specify a groupTitleField. This will cause the group node titles to appear in that field. Note that as part of the refactoring to fix the 2 issues above we made a change in this area to resolve a related issue, so if you want to experiment with this, wait for the next nightly.

          Another possibility is the 'showGroupSummaryInHeader' mode you've already been experimenting with. Also check out the docs for the 'showGroupTitleColumn' attribute - this governs having a special column for the group titles in this group-summary-in-header mode.

          Regards
          Isomorphic Software

          Comment


            #6
            thank you very much! the 'next nightly build' is v8.2p_2012-06-08 ?

            thanks also for the very detailed explanation.

            btw the groupTitleField is nice for my case.

            Comment

            Working...
            X