Author Topic: Multicell selection without ctrl key  (Read 6189 times)

[email protected]

  • Newbie
  • *
  • Posts: 3
    • View Profile
Multicell selection without ctrl key
« on: August 03, 2013, 03:03:21 am »
 I'm using PQ to display data to users where they select any number of cells to post back to server. Users may select all cells in a column by clicking on a column header or select individual cells. However a row cannot have more than one cell selected. I jsFiddled some hackety-hack code that basically gets at what the users want but it's buggy -- if I select CellA, then CellB in the same row, CellA deselects. This is good. But If I go back and reselect CellA the ui does not update the cell with the selection color. I tried using some jq dom work to inject the class with no luck. When the refreshDataAndView is invoked it removes the injected class. Here's my jsFiddle:


http://jsfiddle.net/xBJxh/5/
« Last Edit: August 03, 2013, 03:47:31 am by [email protected] »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Multicell selection without ctrl key
« Reply #1 on: August 05, 2013, 11:15:16 pm »
It looks like an issue.

I've opened a ticket

https://github.com/paramquery/grid/issues/67

[email protected]

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Multicell selection without ctrl key
« Reply #2 on: August 09, 2013, 03:50:07 am »
Took a while and a lot of hackery but I assembled something that performs the job. Basically I had to assemble a selectedDataIndices object and attach this to the dataModel so that PQ knew if the cell was selected (when out of view), add / remove data from the cell selection set, add / remove the css selection classes depending on a condition and lastly invoke the refresh method. Like a said it's hacky and not perfect, but it seems to be working. Here's the new jsfiddle:

http://jsfiddle.net/xBJxh/22/
« Last Edit: August 09, 2013, 07:44:50 pm by [email protected] »