Announcement

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

    BUG - TileRecord.tileConstructor is being overwritten by TileGril.tileConstructor

    Hi,

    Here is a code tested in current showcase:
    Code:
    isc.TileGrid.create({
       tileConstructor: "Button",
       data: [
         { tileConstructor: "Label", tileProperties: { getInnerHTML: function() { return this.getClassName() }} },
         { tileConstructor: "Canvas", tileProperties: { getInnerHTML: function() { return this.getClassName() }} },
       ]
    });
    From what I have seen in the code tileGrid.makeTile correctly gets constructor in
    Code:
    var theConstructor = record.tileConstructor ? record.tileConstructor : this.tileConstructor;
    , and passes it to createAutoChild, but later in getAutoChildClass it is again overwritten with this[childName + this._$Constructor] == this["tile" + "Constructor"] == tileGrid.tileConstructor.
    Code:
     
    return this[childName + this._$Constructor] ||
                   (dynamicProperties ? dynamicProperties._constructor : null) ||
                   (childProperties ? childProperties._constructor : null) ||
                   (childDefaults ? childDefaults._constructor : null) ||
                   defaultConstructor || isc.Canvas;
    Best regards,
    Janusz

    #2
    Hi,

    Have you had a chance to check this issue?

    Best regards,
    Janusz

    Comment


      #3
      This should be resolved back to SC 11.1p in the nightly builds dated 2020-04-29. You can see the new functionality clearly with this code:
      Code:
      isc.TileGrid.create({
         width:240, height:240, tileSize:100,
         tileConstructor: "Button",
         tileProperties:{
             backgroundColor:"#AAAAFF",
             getTitle : function(){return this.getClassName();},
             getContents:function(){return this.getClassName()}
         },
         data: [
           { tileConstructor: "Label"},
           { tileConstructor: "Canvas"},
           { tileProperties: {border:"0px"}}
         ]
      });
      Note the varying position and color of the title, which is due to differences in the default behavior of Button, Label, and Canvas.

      Comment

      Working...
      X