EasyUI Forum
October 16, 2025, 09:26:41 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: combogrid scroll to value on dropdown  (Read 15009 times)
gurpal2000
Newbie
*
Posts: 14


View Profile
« on: September 13, 2012, 04:26:19 PM »

I have a combogrid with 100 items and after selecting a value about half way, if i dropdown again, the value is not in the data view (item is highlighted though).
How can i get the datagrid to scroll to the selected/highlighted item?

thanks
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: September 13, 2012, 07:41:53 PM »

The grid retain its scroll position unless you change its value. So when dropping down the grid, the selected row will be in visible area.

If you want to scroll to the selected row, call 'selectRecord' or 'selectRow' method to select that row again when the grid is visible.
Logged
gurpal2000
Newbie
*
Posts: 14


View Profile
« Reply #2 on: September 14, 2012, 12:44:58 PM »

So in my code i have like a Next/Previous button which allows a logical navigation thru the contents of the combogrid. It's time based data you see.

In my button i do something like:

Code:
$('#comboSearch').combogrid('grid').datagrid('selectRow', newindex);

and this fires off a 'onselect' event.

If i drop down the grid, why would i call selectRow again? that will fire off another onselect no?

I've used selectRow but the highlighted item does not scroll into view. The combogrid example/demo you have also exhibits this behaviour)
« Last Edit: September 14, 2012, 01:49:45 PM by gurpal2000 » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: September 14, 2012, 06:00:48 PM »

When datagrid is hidden, calling 'selectRow' method will highlight the specify row but cannot scroll to this row. I don't known where your navigate buttons are placed. Maybe making them in the datagrid toolbar is a good idea. Also, you can directly bind the keydown and keyup events on combogrid textbox to implement the record navigation functionality.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!