1

I would like to enable text selection in a grid. I'm aware that this is possible by pressing the cmd button, unfortunately most user doesn't know that.

Is there any configuration I'm not aware of? Or where could I enable that? Thanks

bmr
  • 11
  • 1

2 Answers2

0

You can find here all the properties for the grid component: http://w2ui.com/web/docs/1.5/grid/properties

There is no setting to change how text selection works in the grid. Now you can either fork the whole library (make your own copy basically) and start changing how it works but that is hard.

Alternatively, you could use a different library.

The last option I can think of is to keep using w2ui but build your own grid component from scratch. Also a lot of work, but probably less than maintaining your own fork with a couple small changes.

alextes
  • 1,817
  • 2
  • 15
  • 22
  • Thanks, I would like to keep the w2ui framework and also a fork is way to much work for me. – bmr Apr 29 '20 at 19:04
0

You could make the grid cells (or rather columns) editable, so the user can easily copy content from the grid.

{ field: 'text', caption: 'text', size: '120px', sortable: true, resizable: true, 
    editable: { type: 'text' }
},

You can find a working example here:

http://w2ui.com/web/demos/#!grid/grid-21

You could also combine this with grid.selectType: 'cell' to make the grid behave similar to MS Excel:

http://w2ui.com/web/demos/#!combo/combo-3

Mike Scotty
  • 10,530
  • 5
  • 38
  • 50
  • That looks good, but I don't wan't to make the cell editable. The problem ist, that the table contains some number which a user sometimes needs to copy/paste it to another program. – bmr May 05 '20 at 11:01
  • @bmr, You can make cells you want allow copy content to type editable as shown in the Answer section, plus you can then set attribute `readonly` to those editable cells. Therefore they can only copy the value content. Thanks. – Houy Narun Aug 09 '22 at 12:01