Announcement

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

    [bug] getCellHoverComponent gets called multiple times while hovering on a cell

    SmartClient Version: v9.0p_2013-10-13/EVAL Development Only

    modify #hoverDetails sample like this:
    Code:
    isc.ListGrid.create({
        ID: "itemList",
        width:500, height:300, 
        alternateRecordStyles:true,
    
        dataSource: supplyItemWithOps,
        fetchOperation: "outputsLimitedFetch",
        autoFetchData: true,
        
        fields: [
            {name: "itemName"},
            {name: "SKU", showHover:true},
            {name: "category"}
        ],
    
        canHover: true,
        showHover: true,
    
        showHoverComponents: true,
    
        getCellHoverComponent : function (record, rowNum, colNum) {
          if (this.getFieldName(colNum) === "SKU") {
                if (!window.notaCanvas) {
                    isc.Canvas.create({
                        ID: "notaCanvas",
                        styleName: "canvasHover",
                        width: 525
                    });
                }
                supplyItemWithOps.fetchData({itemName:record.itemName},
                    function (dsResponse, data, dsRequest) {
                        if (window.notaCanvas) {
                            notaCanvas.setContents(data[0].itemName);
                        }
                    }
                 );
                return notaCanvas;
            }
        }
    });
    then hover on a SKU cell, and move the mouse pointer without exiting the cell. You'll see multiple fetches in the RPC tab.
    I don't know what's causing this behaviour in my sample, but I've got multiple use cases in our app, where with 8.3 this wasn't happening.

    #2
    You need to set showPrompt:false on your fetchData() call or you are showing a modal mask blocking interactivity during the fetch, which sends the grid a mouseOut and dismisses the hover.

    This would have been true for any version. Most likely you changed settings when switching to 9.0.

    Comment


      #3
      yes it fixes the problem, thank you very much

      Comment

      Working...
      X