Announcement

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

    Possible issue in ListGrid.getStretchResizeWidths

    Hi,
    I was fighting with an issue that my picklist was not resizing to show all the content. It was never larger than the width of the formitem. After a lot of debugging I found that it is probably caused by these lines in ListGrid.getStretchResizeWidths

    Code:
            for (var i = 0; i < hasDynamicDefaults.length; i++) {
                if (calculatedWidths[i] < autoFitWidths[i]) {
                    fieldOverflowed = true;
                    widths[i] = autoFitWidths[i];
                }
            }
    The error is that the index should be taken from the hasDynamicDefaults, so within the if not i should be used as the index but the value of: hasDynamicDefaults[i]

    So I think the correct line should be:
    Code:
            for (var i = 0; i < hasDynamicDefaults.length; i++) {
                var j = hasDynamicDefaults[i];
                if (calculatedWidths[j] < autoFitWidths[j]) {
                    fieldOverflowed = true;
                    widths[j] = autoFitWidths[j];
                }
            }
    gr. Martin

    #2
    Hi gr. Martin,
    Your update looks like it is correct but can you show us the actual case that was failing for you?

    It seems like you'd need to have pickListFields specifying width as a string (like a percentage or "*" to hit this particular problem). Before we apply the patch we'd like to see the case you hit so we can be sure there's nothing else going on here that we need to be aware of.

    Thanks
    Isomorphic Software

    Comment


      #3
      Hi,
      Here is an example with the simple filter example from the feature explorer:

      It does not occur if multiple is not set to true.

      Code:
      isc.ListGrid.create({
          ID: "countryList",
          width:500, height:300, alternateRecordStyles:true,
          dataSource: worldDS,
          fields:[
              {name:"countryCode", title:"Code", width:50},
              {name:"countryName", title:"Country"},
              {name:"continent", title:"Continent", width: 40, 
      multiple: true,
      valueMap: {
      a: 'asd adas dasdas asdsa '
      }
      },
              {name:"capital", title:"Capital"}
          ],
          autoFetchData: true,
          showFilterEditor: true
      })

      Comment


        #4
        Great that's very clean and yes - the multiple flag is adding the extra field, leading to the mismatch between "i" and "j" vars in your reworked for-loop.

        Thanks for taking the time to debug this and show a clean example. We're folding your change into the framework code.
        Regards
        Isomorphic Software
        Last edited by Isomorphic; 19 Oct 2012, 08:59.

        Comment

        Working...
        X