How can i dettach the "Selector Class"

Posted by: lost7l on 14 February 2023, 7:59 pm EST

    • Post Options:
    • Link

    Posted 14 February 2023, 7:59 pm EST

    hello thank you for your supporting.

    i have a question about dettaching the “Selector Class” in using flexgrid with react.

    normally i’ve been attached the Selector Class to my grid component like codes below:

    [flexGrid, setFlexGrid] = useState();
    



    initializeGrid(flexGrid) {

    setFlexGrid(flexGrid);

    new Selector(flexGrid);



    return(

    <>

    <FlexGrid initialized={s => initializeGrid(s)} />

    but i can’t find the way of dettaching the Selector.

    i want to dettach the module dynamically through button or context menu.

    <button onClick={() => { ((dettachig or removing / attaching the Selector)) }}> …

    i think there is some ways to deal with it. like… refreshing rowHeaders or rerender the grid or something…

    plz help me

  • Posted 15 February 2023, 10:03 pm EST

    Hi,

    We may achieve this by resetting the column property of the Selector attached to the grid. Please refer to this sample for reference

    https://codesandbox.io/s/selector-dynamic-removal-or-addition-forked-i5680i

    Regards,

    Manish Gupta

  • Posted 21 February 2023, 6:38 pm EST

    thank you soooo much

Need extra support?

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

Learn More

Forum Channels