Persisting Pinning of Column

Posted by: jacob.evans on 3 September 2023, 8:24 pm EST

  • Posted 3 September 2023, 8:24 pm EST

    Hi, I am trying to persist the pinning of the grid columns. Unfortunately I am unable to use the stored columnLayout on the grid, and instead have a custom solution, which utilizes the column collection. However, when listening to the pinnedColumn event, the columns have not updated to reflect the pinned column being moved to the beginning of the grid. is there another event that I can use to get this updated grid layout?

  • Posted 4 September 2023, 10:38 pm EST

    Hi,

    You can use the frozenColumns property of the FlexGrid Class to store the state of pinned columns. At the time of saving the state of the FlexGrid please store the value of frozenColumns property and at the time of restoring the layout please use the stored value of frozenColumns to restore the state of pinned columns.

    Please refer to this API reference for more information on frozenColumns property: https://www.grapecity.com/wijmo/api/classes/wijmo_grid.flexgrid.html#frozencolumns

    Please refer to this sample for reference: https://jscodemine.grapecity.com/share/KjRikwqBRkyVkdTriIRK0Q

    Regards,

    Anirudh

  • Posted 6 September 2023, 7:35 pm EST

    Hi Anirudh,

    My issue is that this only gives me the count of the pinned columns. Whilst I can get this from the pinnedColumn event, the column collections index values for each column are not updated (although I would have expected them to be, as the event does provide the new index of the pinned column).

    Cheers,

    Jacob

  • Posted 7 September 2023, 3:46 pm EST

    Hi Jacob,

    After restoring the layout or in the handler of the pinnedColumn event, I can access the latest index value for each column in the columns collection. So, I am unable to replicate the issue on my end could you please verify if the issue is coming in the below-modified sample or not? If the issue does not replicate in the below sample and is occurring in your application then it might be possible that the issue is related to some other functionality that is being used in the application. In that case, kindly share a sample replicating the issue along with the steps needed to replicate the issue.

    You can also modify the below-shared sample to replicate the issue that you are facing on your end. Also, please share the details regarding the Wijmo version that you are using in your application and if you are using any framework or not.

    Please refer to this sample for reference: https://jscodemine.grapecity.com/share/Gv4PD0XeqkW9m-2h-s6UAg

    Thank you.

    Regards,

    Anirudh

Need extra support?

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

Learn More

Forum Channels