Show-Hide Filter Dialog PopUp

Posted by: barweprashant91 on 11 October 2018, 10:28 pm EST

    • Post Options:
    • Link

    Posted 11 October 2018, 10:28 pm EST

    Hi team,

    i want to open filter dialog popup from the keyboard key-press event (same as excel sheet), for the implementation i go with openFilterDialog method in angular 6 but here unable to find filterButtonHitInfo parameter not contain in sheet.hitTest(97, 30) return data.

    kindly check and provide the resolution. Thanks.

  • Posted 15 October 2018, 2:01 am EST

    Hello,

    You need find out the X and Y cordinates of filterButton and then pass it in this method. To know X and Y cordinates you can use HitTest method of SpreadJS:

    http://help.grapecity.com/spread/SpreadSheets11/webframe.html#SpreadJS~GC.Spread.Sheets.Worksheet~hitTest.html

    Thanks,

    Deepak Sharma

  • Posted 21 October 2018, 10:22 pm EST

    HI Deepak,

    I have passed X and Y coordinates of filterButton but its not work, properly every time its open from (0,0) index and filter item not showing inside dialog box.

    Demo Code:

    var cellRect = activeSheet.getCellRect(activeSheet.getActiveRowIndex(), activeSheet.getActiveColumnIndex());

    console.log(“X coordinate:” + cellRect.x);

    console.log(“Y coordinate:” + cellRect.y);

    //console.log(“Cell width:” + cellRect.width);

    //console.log(“Cell height:” + cellRect.height);

    //console.log(spread.hitTest(cellRect.x, cellRect.y));

    //var cellrange = new GC.Spread.Sheets.Range(rowStartIndex, colStartIndex, (rowEndIndex - rowStartIndex) + 1, (colSEndIndex - colStartIndex) + 1);

    var cellrange = new GC.Spread.Sheets.Range(rowStartIndex, activeSheet.getActiveColumnIndex(), (rowEndIndex - rowStartIndex) + 1, 1);

    var hideRowFilter = new GC.Spread.Sheets.Filter.HideRowFilter(cellrange);

    activeSheet.rowFilter(hideRowFilter);

    //activeSheet.rowFilter(new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range(15, 5, 10, 1)));

    // activeSheet.rowFilter().openFilterDialog(cellRect.x, cellRect.y, cellRect.x, cellRect.y);

    activeSheet.rowFilter().openFilterDialog(spread.hitTest(cellRect.x, cellRect.y));

    Thanks.

  • Posted 23 October 2018, 1:06 am EST

    Hello,

    Please have a look at the example below on how to show a filter on click on of button using “openfilterDialog”:

    
     var sheet = spread.getActiveSheet();
                spread.suspendPaint();
                for (var i = 0; i < 10; i++) {
                    sheet.setValue(i, 0, i);
                }
                sheet.rowFilter(new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range(1, 0, 10, 1)));
                spread.resumePaint();
                $("#btn").click(function () {
                    sheet.rowFilter().openFilterDialog(sheet.hitTest(97, 30).filterButtonHitInfo);
                });
    
    

    Thanks,

    Deepak Sharma

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels