Data Grid - Image Hovering Preview

This example focuses on the new image hovering feature in the datagrid. This feature is enabled by default when a datagrid is created. To disable or enable this feature at later time, the command enablePicturePreview(true/false) must be called before the grid is created with the go() command.

    Syntax: myGrid.enablePicturePreview(true/false);

In this example, 2 wrapper functions (enableImageHover and disableImageHover) are created to keep each option separated. The main differences of each function is the parameter that is passed into the command enablePicturePreview();

    function enableImageHover(){
        if(!hoverenabled){
            if(myGrid != null)
                myGrid.destroy();
            myGrid = new dax_dataGrid('Contacts', $('mydiv'), 1, 0, false);
            myGrid.enablePicturePreview(true);
            myGrid.go();
            myGrid.allowEditor(false);
            hoverenabled = true;
        }
    }

    function disableImageHover(){
        if(hoverenabled){
            if(myGrid != null)
                myGrid.destroy();
            myGrid = new dax_dataGrid('Contacts', $('mydiv'), 1, 0, false);
            myGrid.enablePicturePreview(false);
            myGrid.go();
            myGrid.allowEditor(false);
            hoverenabled = false;
        }
    }