columnLayout is not working with the custom templates

Posted by: kundena.sudhakar on 24 October 2017, 3:04 am EST

    • Post Options:
    • Link

    Posted 24 October 2017, 3:04 am EST

    We have a flex-grid defined using custom templates and data mapping to angularJS methods. We are planning to persist the order of the columns / size of the columns when user drags and display in the same order when user visits the grid next time.

    Tried your’s below solutions :

    https://www.grapecity.com/en/forums/wijmo/persist-flexgrid-state

    http://demos.wijmo.com/5/Angular/Explorer/Explorer/#/grid/columnLayout

     function saveColumnLayout(s) {
            if (localStorage) {
                localStorage['columns'] = s.columnLayout;
                console.log('**LAYOUT: ' + s.columnLayout);
            }
        }
    
        function loadColumnLayout(s) {
            if (localStorage['columns']) {
                s.columnLayout = localStorage['columns'];
            }
        } 
    

    called these functions :

    dragged-column=" saveColumnLayout (s,e)"

    loaded-rows=" loadColumnLayout (s,e)"

    But I see when the grid retrieved from the localStorage. I see the images / values of columns which has custom templates are go missing.

  • Posted 24 October 2017, 8:03 pm EST

    Hi,

    ColumnLayout[1] does not retain dataMap and custom cell template information. You can persist custom cell template information using dynamic column. Please refer to the attached sample for the same.

    Please let us know if you have the further query related to this case.

    ~Manish

    [1] http://demos.wijmo.com/5/Angular/WijmoHelp/WijmoHelp/topic/wijmo.grid.FlexGrid.Class.html#columnLayout

    Dynamice_column_FlexGrid_cellTemplate (2).zip

  • Posted 30 October 2017, 2:37 am EST

    Thanks Manish.

    The sample code uses typescript and bit difficult to understand the implementation.

    Can you please provide me the AngularJS version of the solution. Basically I would like to understand how is getting generated dynamically.

    Regards,

    Sudhakar

  • Posted 30 October 2017, 5:54 pm EST

    Hi Sudhakar,

    Please find the attached sample for AngularJS.

    ~Manish

    FlexGrid_dynamicColumn_celltemplate_columnLayout.zip

Need extra support?

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

Learn More

Forum Channels