ParamQuery grid support forum

General Category => Help for ParamQuery Grid (free version) => Topic started by: mr_unicoder on May 11, 2014, 10:52:11 pm

Title: How to enable text selection ?
Post by: mr_unicoder on May 11, 2014, 10:52:11 pm
Hello there,
I've started to use PQGrid and I've to say it's a wonderful grid
but I've one issue, i can't select/highlight cell contents while editing is disabled
Is there any way to enable it ?

I've tried the solution in this reply (https://groups.google.com/d/msg/paramquery/RAeolLfBCZc/ZedG-_b7GpsJ) but it didn't work
Title: Re: How to enable text selection ?
Post by: mr_unicoder on May 11, 2014, 11:18:50 pm
I've solved it using:
$('.pq-cont').enableSelection()

but selection got lost on scroll
Title: Re: How to enable text selection ?
Post by: paramvir on May 12, 2014, 01:24:22 pm
Add this code in the refresh event.
Title: Re: How to enable text selection ?
Post by: jkoci@volny.cz on December 07, 2014, 07:26:09 pm
The above solution is not working form me. Am I doing anything wrong?

var grid1=$("#grid_md").pqGrid({
      width: 'auto',
      height: 550,
      colModel: pqcolmodel,
      dataModel: pqdatamodel,
      showTop: false,
      editable: false,
      resizable: false,
      columnBorders: true,
      minWidth: 10,
      pageModel: { type: "local", rPP: 100, rPPOptions:[10, 100, 200, 500] },
      //freezeCols: 0,
      roundCorners: false,
      numberCell: false,
      //scrollModel: {horizontal : false},
      bottomVisible: true,
      stripeRows: true,
      hoverMode: 'row',
      selectionModel: { type: 'row', mode: 'range'}
    });
    $("#grid_md").enableSelection();
Title: Re: How to enable text selection ?
Post by: paramvir on December 08, 2014, 05:38:33 pm
jkoci

PQ pro has its own mechanism to select rows/cells and copy / paste cells, rows. This post is related to native selection of text.

If you want the same then you have to disable the inbuilt selection model and swipeModel of the grid and call enableSelection in refresh event.

Example:
http://jsfiddle.net/8qpmxrye/