Announcement

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

    CubeGrid Cell Context Click

    I'm using SmartClient 10 and I'm struggling trying to get cell context click menus to work with CubeGrids. First of all cellContextClick does not work unless I enable showCellContext menus. Once I do this I get 2 menus that display, my menu with the cellContextMenu on top of it. I have not been able to override or modify cellContextMenu. What is the proper way for me to show my own menu in a cube grid?

    Here is an example of what I'm trying to do using your feature samples
    http://www.smartclient.com/smartclie...html#basicCube

    isc.CubeGrid.create({
    ID: "basicCubeGrid",
    data: productData,
    width: "100%",
    hideEmptyFacetValues: true,

    valueFormat: "\u00A4,0.00",

    columnFacets: ["quarter", "month", "metric"],
    rowFacets: ["region", "product"],

    // configure export colors
    exportFacetTextColor: "blue",
    exportFacetBGColor: "yellow",

    exportColumnFacetTextColor: "red",
    exportColumnFacetBGColor: "#44FF44",

    exportDefaultBGColor: "#FFDDAA",

    cellContextClick: function(record,rownum,colnum) {


    var menu = isc.Menu.create({
    data: [
    {
    name: 'view',
    title: 'View Report',
    click: function(item) {
    debugger;
    }
    },
    {
    name: 'update',
    title: 'Recheck',
    click: function(item) {
    debugger;
    }
    }
    ]
    });
    menu.showContextMenu();
    },
    showCellContextMenus: true

    });

    #2
    Oops. Didn't put that example in code blocks.

    Code:
    isc.CubeGrid.create({
        ID: "basicCubeGrid",
        data: productData,
        width: "100%",
        hideEmptyFacetValues: true,
    
        valueFormat: "\u00A4,0.00",
        
        columnFacets: ["quarter", "month", "metric"],
        rowFacets: ["region", "product"],
    
        // configure export colors
        exportFacetTextColor: "blue",
        exportFacetBGColor: "yellow",
    
        exportColumnFacetTextColor: "red",
        exportColumnFacetBGColor: "#44FF44",
    
        exportDefaultBGColor: "#FFDDAA",
    
        cellContextClick: function(record,rownum,colnum) {
    
                var menu = isc.Menu.create({
                        width: 200,
                        data: [
                        {
                            name: 'view',
                            title: 'View Report',
                            click: function(item) {
                                debugger;
                            }
                        },
                        {
                           name: 'update',
                           title: 'Recheck',
                           click: function(item) {
                                debugger;
                            }
                        }
                        ]
                 });
                menu.showContextMenu();
    
        },
    
        showCellContextMenus: true
    
    });

    Comment


      #3
      You are missing "return false" to cancel the default behavior.

      Comment


        #4
        Thank you so much.

        Comment

        Working...
        X