Author Topic: Inline edititing with height flex  (Read 1948 times)

fmusignac

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 11
    • View Profile
Inline edititing with height flex
« on: July 31, 2017, 10:18:54 pm »
When our users are double clicking on a cell for editing its contents, the grid is removing all the rows above the one that was clicked on. I was able to narrow the the issue to having the height option on the grid set to 'flex'. It only happens when that option is set to that value. Is there another way to use the flex height without having the sort of issue we're having?
Our editable cell is set up like this:
           {dataIndx: 'foo',
            title: 'Foo',
            dataType: 'stringi',
            width: '17%',
            minWidth: 175,
            editable: true}
Our grid has the following options:
{
   bootstrap: { on: true, grid: "pq-small-font-grid" },
   collapsible: { on: false, toggle: false },
   columnTemplate: { halign: 'center', minWidth: 40, resizable: true },
   roundCorners: true,
   showTop: false,
   showTitle: false,
   showBottom: false,
   showToolbar: false,
   numberCell: false,
   minWidth: 200,
   oddRowsHighlight: true,
   columnBorders: false,
   wrap: false,
   hoverMode: 'none',
   virtualX: true,
   virtualY: true,
   editModel: { clicksToEdit: 1 }
   height: 'flex',
   selectionModel: { type: 'row' },
   showTop: true,
   freezeRows: 1,
   showToolbar: true,
   scrollModel: { autoFit: true },
   showBottom: true,
   editable: true,
   editModel: {
      saveKey: $.ui.keyCode.ENTER,
      keyUpDown: false,
      cellBorderWidth: 0
   },
   change: function (evt, ui) {
      if (ui.source == 'edit') {
         //Call API to save values and reload.
      }
   },
   beforeSort: function (evt, ui) {
      var freezeRows = this.option("freezeRows"),
         dataGrid = this.option("dataModel.data");
      frozenRows = dataGrid.splice(0, freezeRows);
   },
   sort: function (evt, ui) {
      var dataGrid = this.option("dataModel.data");
      Array.prototype.unshift.apply(dataGrid, frozenRows);
   }
}

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Inline edititing with height flex
« Reply #1 on: July 31, 2017, 10:21:57 pm »
This issue is caused when height: 'flex' and virtualY: true are used together.

Please use virtualY: false when height: 'flex'

fmusignac

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Inline edititing with height flex
« Reply #2 on: July 31, 2017, 10:52:27 pm »
That corrected the issue. Thanks for your prompt response!