Author Topic: prevent focus on row selection  (Read 3633 times)

ckrosnowski

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 5
    • View Profile
prevent focus on row selection
« on: September 18, 2014, 09:21:21 pm »
hello,

I have a page that has a google map on top, and a pq grid on bottom.
the markers on the map all have corresponding entries in the grid.
when a google map marker is clicked, I do this to highlight the corresponding pq grid row:

     $("#gridContainer").pqGrid("setSelection", null);
     $("#gridContainer").pqGrid("setSelection", { rowIndx: (this.Assignments[0].DisplayNumber - 1) });

alternatively, when a pq grid row is clicked, I have a custom function that simulates a map marker click / highlights the corresponding google map icon.

the problem is, when I use (the above code for pq grid) to highlight the grid row, it commands focus.
this is not a good thing since the map takes up most of the page, and if the user is looking at the map and clicks an icon,
the page scrolls down / away from the map to the pq grid to honor its focus.

how can I prevent this focus on row selection from happening?

many thanks!

btw - this plugin ROCKS!!!!  NICE WORK!!!!!!!



paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6298
    • View Profile
Re: prevent focus on row selection
« Reply #1 on: September 18, 2014, 11:13:29 pm »
I'm glad that you like ParamQuery. Thank you!

you can prevent the row from getting focus by passing focus: false as argument to setSelection method.

$( ".selector" ).pqGrid("setSelection", { rowIndx: rowIndx, focus: false });

Example:

http://paramquery.com/pro/demos/selection_row