Announcement

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

    Conditional hover width for getCellHoverComponent

    Hi Isomorphic,

    please see this modified sample (v11.1p_2018-04-07, only one line added. I'm using SmartGWT, but here it is happening in a similar fashion).
    My goal is to define the width of the resulting hover in getCellHoverComponent(). The "500" here will depend on the hover I'm displaying - this hover will differ for different rows/cells.
    As you can the, the setting is not watched at all here.
    In my SmartGWT application it is watched (via setHoverWidth(500)), but always for the next hover, not the current one, making the behavior very random for the user.
    Is this a bug? If not, how to implement this?

    Code:
    isc.ListGrid.create({
        ID: "itemList",
        width:500, height:300, 
        alternateRecordStyles:true,
    
        // use the supplyItemWithOps dataSource and use it's "outputsLimitedFetch" operation.
        // this demonstrates using "outputs" on an operationBinding to forcibly limit the data 
        // retrieved for each row
        dataSource: supplyItemWithOps,
        fetchOperation: "outputsLimitedFetch",
        autoFetchData: true,
    
        fields: [
            {name: "itemName"},
            {name: "SKU"},
            {name: "category"}
        ],
    
        // allow Hovers
        canHover: true,
        showHover: true,
    
        // allow hoverComponents
        showHoverComponents: true,
    
    
        // override the builtin getCellHoverComponent() method so we can return a component of our
        // choosing - in this case, create a DetailViewer, populate it with the entire record from 
        // the server and return it for display
        getCellHoverComponent : function (record, rowNum, colNum) {
    
    [B]itemList.hoverWidth = 800;[/B]
            this.rowHoverComponent = isc.DetailViewer.create({
                dataSource: supplyItemWithOps,
                width: 250
            });
    
            this.rowHoverComponent.fetchData({itemID: record.itemID}, null, { showPrompt: false} );
    
            return this.rowHoverComponent;
        }
    });
    Best regards
    Blama

    #2
    canvas.hoverWidth - which is what you are setting here - configures the built-in, simple-text-only hovers that are supported by all Canvas-derived components. The ListGrid's special notion of "hover components" is separate. To control the width of a hover component, just set it's width normally (as for any other component).

    Comment


      #3
      Hi all,

      this was a bug that was fixed here.

      Best regards
      Blama

      Comment

      Working...
      X