Announcement

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

    bug in placement of record components with snapTo

    Hi,

    This bug was some time after introduced after 2017-04-21.

    When using cell components with snapTo and width properties they are initially snapped to ListGrid not to cell, but the width (if set in percent) are relative to cell's width not ListGrid's width.
    Sometimes the bug is not initially visibile but appears after the browser window is resized. It disappears after ListGrid.redraw() then appears after again resize etc.

    Tested on current Chrome, Safari and Firefox.

    Test case:
    Code:
     isc.DataSource.create({
          ID: "xyz",
          clientOnly: true,
       
          fields: [
            {name: "id", canEdit: false},
            {name: "quantity", type: "integer"}
          ],
       
          cacheData: [
            {id: "XXX", quantity: 1},
            {id: "YYY", quantity: 2},
            {id: "ZZZ", quantity: 3}
          ]
       
        });
       
      isc.ListGrid.create({
          dataSource: "xyz",
          autoFetchData: true,
          width: "100%",
          height: "100%",
          autoDraw: true,
          cellHeight: 40,
       
          showRecordComponents: true,
          showRecordComponentsByCell: true,
          recordComponentPoolingMode: "recycle",
          showRecordComponent: function(record, colNum) {
            return (this.getFieldName(colNum) == 'quantity');
          },
       
          cellComponentDefaults: {
            _constructor: isc.DynamicForm,
            width: "50%",
            snapTo: "L",
            numCols: 1,
            cellPadding: 0,
            fields: [
      {name: "quantity", width: "100%", showTitle: false, editorType: "SpinnerItem",
      }
            ]
          },
       
          createRecordComponent: function(record, colNum) {
            var form = this.createAutoChild("cellComponent", {dataSource: this.getDataSource()});
            form.editRecord(record);
            return form;
          },
          updateRecordComponent: function(record, colNum, component, recordChanged) {
            if(this.getFieldName(colNum) == "quantity") {
      return component.editRecord(record.id);
            }
            return null;
          },
       
          fields: [
            {name: "id"},
            {name: "quantity", canEdit: false, minWidth: 80, maxWidth: 100}
          ]
       
        });
    Best regards,
    Janusz

    #2
    This should be resolved in today's builds (marked 2017-07-05) for SC 11.1p and newer branches, and will be resolved in tomorrow's builds (marked 2017-07-06) for the SC 11.0p branch..
    Last edited by Isomorphic; 5 Jul 2017, 13:24.

    Comment

    Working...
    X