Grid not init after set grid to style="display:none" to style="dislpay:block"

Posted by: arulventhan.palanimuthu on 11 January 2018, 1:16 am EST

    • Post Options:
    • Link

    Posted 11 January 2018, 1:16 am EST

    Hello,

    Please look into below HTML

    1. When there is no data on data i set that
    $scope.isEmptyGrid=true
    

    .2. In this case when i make

    $scope.isEmptyGrid=false
    

    , That time all grid class property set to width and height to zero.3. Again i reload the grid its showing.

     <div id="grid1" ng-show="!isEmptyGrid"></div>
                        <div id="EmptySchedular" ng-show="isEmptyGrid" class="text-center" style="margin-top:15%;">
                            <span style="padding:3px;">
                              No Record found
    </span>
                            </span>
                        </div>
    

    I used

    dataView.invalidate();
    ``` and ```
    dataView.destroy();
    

    And also i try to use

    document.querySelector('#grid1').focus();
    

    was not applying

    And my code is below

    dataView = new GC.Spread.Views.DataView(document.getElementById('grid1'), $scope.Data, columns,
                          new GC.Spread.Views.Plugins.GridLayout(
                          {
                              allowSorting: false,
                              showColHeader: true,
                              showRowHeader: false,
                              allowResizing: true,
                              selectionMode: 'single',
                              showToolPanel: false,
                              allowColumnReorder: true,
                              allowCellMerging: true,
                              //grouping: grouping
                          }));
                    
                       dataView["rowClick"].addHandler(rowClickFun);
                       dataView["rowDbClick"].addHandler(rowDbClickFun);
                       dataView['columnReorder'].addHandler(columnReorderFun);
                       dataView['columnChanged'].addHandler(columnChangedFun);
                       dataView.invalidate();
                       document.querySelector('#grid1').focus();
    dataView.setSelections(token.ctRow, 0);
    

    Help me to get solution.

    Thanks,

    Arulventhan NP

  • Posted 14 January 2018, 10:31 pm EST

    Hi Arul,

    I am having no trouble in toggling the display of spread.view. Please have a look at the attached video and sample html page.

    Thanks,

    Deepak Sharma

    ActionColumn.zipSpreadViewToggleDisplay.zip

Need extra support?

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

Learn More

Forum Channels