ParamQuery grid support forum

General Category => Help for ParamQuery Grid (free version) => Topic started by: srailsback@gmail.com on August 03, 2013, 03:03:21 am

Title: Multicell selection without ctrl key
Post by: srailsback@gmail.com 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/
Title: Re: Multicell selection without ctrl key
Post by: paramvir 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
Title: Re: Multicell selection without ctrl key
Post by: srailsback@gmail.com 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/