Only show Marquee when a cell is selected

Posted by: peter_murray on 12 May 2021, 7:43 am EST

    • Post Options:
    • Link

    Posted 12 May 2021, 7:43 am EST - Updated 3 October 2022, 4:55 am EST

    I’m using the wijmo flex grid with showMarquee set to true, however, I would only like this marquee to appear when a user clicks inside the grid. Conversely, when the user clicks outside the grid, I would like for the marquee to disappear.

    Additionally, there are some pages in my application that show more than one flex grid at a time. So I would like all of the functionality above in addition to only having the marquee appear in the table that the user selected a cell in. Is this possible with current functionality?

  • Posted 12 May 2021, 10:42 pm EST

    Hi Peter,

    You can use the following CSS to hide the marquee when the grid is not focused:

    .wj-flexgrid:not(.wj-state-focused) .wj-marquee {
        display: none;
    }
    

    Regards,

    Ashwin

  • Posted 14 May 2021, 2:34 am EST

    Thank you Ashwin for the reply, that worked perfectly, but it raises another question. When I’m using this marquee, and I click and drag to select some cells, the active cell becomes the last cell I dragged my mouse over. The same can be said for the keyboard controls.

    Is there any way to reverse this behavior? I would like for the first cell selected of multiple to be the active cell, not the last.

  • Posted 16 May 2021, 6:38 pm EST

    You can achieve this by setting the anchorCursor property of FlexGrid to true. Please refer to the API:

    https://www.grapecity.com/wijmo/api/classes/wijmo_grid.flexgrid.html#anchorcursor

    ~regards

  • Posted 17 May 2021, 2:26 am EST

    Again, thanks for the help, that worked great, but I have another question related to the marquees. Is it at all possible to prevent the marquee from showing up for a cell that is in an invalid (.wj-state-invalid) state? I’m running into a problem where when a cell is in an invalid state, and the border shows up to indicate such, and then when I click the invalid cell to make it the active cell, the marquee appears on top of the red border.

    What also happens is that while the mouse is still hovering over this cell, and the cell is being edited and/or is just simply active, the marquee remains, covering up the red border I configured to show up for invalid cells.

    I know this is all related to the marquee because I disabled it and this behavior is no longer present. The behavior I desire would be to have no marquee present at any time for any cell that is in an invalid state. Is this possible?

  • Posted 18 May 2021, 12:02 am EST

    Hi Peter,

    We cannot hide the marquee on the invalid cells same as with the focused state due to the design of FlexGrid. Instead, you can increase the z-index of the invalid cells so that the marquee is displayed below the red border of the invalid cells. You can also increase the width of the invalid border to increase the readability:

    .wj-cell.wj-state-invalid {
        z-index: 1;
        border: 2px solid red;
    } 
    
    

    ~regards

  • Posted 11 May 2023, 12:31 am EST

    Additionally, there are some pages in my application that show more than one flex grid at a time. So I would like all of the functionality above in addition to only having the marquee appear in the table that the user selected a cell in. Is this possible with current functionality?

  • Posted 14 May 2023, 5:27 pm EST

    Hi Rajnath,

    Could you please explain your requirements with more detailed information? as the response just before yours was spam and has been removed from this post. So to answer your query, we require more information about the functionality you want to achieve.

    Regards

Need extra support?

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

Learn More

Forum Channels