Author Topic: show hide is not working when virtualX:true  (Read 3261 times)

jeeva

  • Newbie
  • *
  • Posts: 29
    • View Profile
show hide is not working when virtualX:true
« on: May 23, 2017, 08:24:17 pm »
Dear support,

I am using 120 column grid.

Increasing the performance used virtualX:true option.After I have integrated Show / hide column option.But when deselect the freezed column not working properly.While virtualX:false its working fine.Can you please help me to fix this issue.

var obj;   
      obj = {
         title:vm.title,
         height: 400,         
         freezeCols:8,         
         hwrap:true,         
         filterModel: { on: true, mode: "AND", header: false },
         editModel: {
            clicksToEdit: 1,
            saveKey: $.ui.keyCode.ENTER,
            cellBorderminWidth: 1
         },
         cellSave: function (event,ui){
            colonCellEdit(ui);
         },               
         virtualX: true,
         virtualY: true,
         showTop: true,         
         selectionModel:{type:null},
         //bubble: true,
         //collapsible: { collapsed : false },
         pageModel: { type:'remote',rPP: UrlService.getRpp(),rPPOptions:UrlService.getRppOptions()},
         scrollModel: {autoFit: false,lastColumn: null},         
         dataModel: dataModel,
         colModel: colModel,                                                         
         resizable: true,
           numberCell: { show: true },
         
          create: function (evt, ui) {

             var CM = this.getColModel(),
                    $sel = $(".columnSelector"),
                    opts = [];
                for (var i = 0; i < CM.length; i++) {
                    var column = CM;
                    if (column.hidden !== true) {
                        opts.push(column.dataIndx);
                    }
                }
                //initialize the selected options in toolbar select list.
                $sel.val(opts);

                //let's disable ShipCountry column.
               //$sel.find("option[value='ck']").prop('disabled', true);
              // $sel.find("option[value='markInfo']").prop('disabled', true);
               
                //convert it into pqSelect.
                $sel.pqSelect({
                    checkbox: true,
                    multiplePlaceholder: 'Select visible columns',
                    maxDisplay: 0,
                    width: '230px'

                });
            },
         toolbar:{
            /**
            * Filter toggle button action
            */
            items:[
               {
                  type:'button',
                  label: 'Filter',
                  listener: function(){
                     this.option('filterModel.header', !this.option('filterModel.header'));
                     this.refresh();
                  }
               },
                    {
                  type:'button',
                  label: 'Reset Filter',
                  listener: function(){
                     this.reset({filter: true});                     
                  }                       
                     },
               {
                  type: 'select',
                  cls: 'columnSelector',
                  attr: "multiple='multiple'", style: "height:600px;",

                  options: function (ui) {
                     var CM = this.getColModel(),                  
                        opts = [];
                     for (var i = 0; i < CM.length; i++) {
                        var obj = {},
                           column = CM;
                           
                        obj[ column.dataIndx ] = column.dataIndx;
                        opts.push(obj);
                     }
                     return opts;
                  },
                  listener: function (evt) {
                     var arr = $(evt.target).find("option:selected").map(function(){
                               return this.value;
                            }).get(),
                        CM = this.getColModel();

                     for (var i = 0; i < CM.length; i++) {
                        var column = CM,
                           dataIndx = column.dataIndx+"";

                        //hide the column if not a selected option.
                        column.hidden = ($.inArray(dataIndx, arr) == -1);
                     }
                     this.option("colModel", this.option("colModel")); //refresh the colModel.
                     this.refresh();
                  }
               }
            ]         
         }                     
      }

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: show hide is not working when virtualX:true
« Reply #1 on: May 30, 2017, 10:49:02 am »
I noticed the same issue, thanks for reporting it.

When virtualX= true, if only frozen columns are made visible, they remain hidden unless at least one of the unfrozen columns is shown.

I've put it under the bug report, fix would be available in next upcoming version.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: show hide is not working when virtualX:true
« Reply #2 on: June 26, 2017, 06:23:26 pm »
This is fixed in v3.4.1