Jump to content


Photo

DBGrid & ScrollIntoView


  • Please log in to reply
13 replies to this topic

#1 Petr Nehez

Petr Nehez

    Member

  • Members
  • PipPip
  • 42 posts

Posted 14 August 2012 - 11:38 AM

I would like to scroll the grid when a new record is created and this record is active.
Is there a way how to do it?

If I locate the record and refresh the grid, the selection is on the right record but the scrollbar is on the top...
  • 0

#2 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 10426 posts

Posted 17 August 2012 - 08:39 PM

here is the workaround which you need to implement in JS code.

http://www.sencha.co...ew-selected-row
  • 0

#3 sagt3k

sagt3k

    Active Member

  • Members
  • PipPipPip
  • 52 posts
  • LocationItaly

Posted 03 September 2012 - 12:11 PM

We may have an example implementation?, I have the same problem when I use the commands ADO.next, ADO.last, ADO.prior, etc.
  • 0

#4 Mediv

Mediv

    Active Member

  • Members
  • PipPipPip
  • 80 posts

Posted 04 September 2012 - 07:23 AM

here is the workaround which you need to implement in JS code.

http://www.sencha.co...ew-selected-row


Hi Farhad, tell me what ClientsEvent can be used on the grid, to avoid this situation.
Thank you.
  • 0

#5 Bruno

Bruno

    Active Member

  • Members
  • PipPipPip
  • 95 posts

Posted 25 February 2013 - 04:51 PM

Anyone found a solution to force the grid to show the selected record?

 

Using version 0.91.0.984.

 

I tried:

 

MyFrame.myGrid.getView().focusRow(number);

MyFrame.myGrid.getView().getSelectionModel().select(number);

MyFrame.myGrid.getView().highlightItem(number);

scrollToView() too.

 

Nothing works.

 

Thx!

 

Bruno


  • 0

#6 Oleg

Oleg

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 56 posts

Posted 26 February 2013 - 04:18 AM

Maybe it will help:

 

if unidbgrid.WebOptions.Paged then
UniSession.AddJS('setTimeout(function () {'+
        'MainForm.unidbgrid.getView().focusRow('+IntToStr((unidbgrid.datasource.dataset.RecNo mod unidbgrid.WebOptions.PageSize)-1)+');'+
    '}, 100);'
)
else
UniSession.AddJS('setTimeout(function () {'+
        'MainForm.unidbgrid.getView().focusRow('+IntToStr(unidbgrid.datasource.dataset.RecNo-1)+');'+
    '}, 100);'
);

 

It works for me))


  • 1

#7 Bruno

Bruno

    Active Member

  • Members
  • PipPipPip
  • 95 posts

Posted 26 February 2013 - 12:20 PM

Oleg, thank you!!!!!!!!!!!!!!!!

 

It works now.

 

I tried so many commands.

 

Bruno


  • 0

#8 Oleg

Oleg

    Active Member

  • uniGUI Subscriber
  • PipPipPip
  • 56 posts

Posted 26 February 2013 - 12:47 PM

glad to help


  • 0

#9 webdev

webdev

    Member

  • uniGUI Subscriber
  • PipPip
  • 13 posts

Posted 11 June 2018 - 06:12 PM

Hi.

 

I'm trying this solution using the version FMSoft_uniGUI_Complete_Professional_1.10.0.1464.

 

But don't work.

 

Help?


  • 0

#10 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 5177 posts

Posted 11 June 2018 - 06:48 PM

Hi,

 

Can you please explain in more details, what problem do you have ?!


  • 0

#11 webdev

webdev

    Member

  • uniGUI Subscriber
  • PipPip
  • 13 posts

Posted 11 June 2018 - 10:23 PM

Hi.

 

I'm using unidbgrid with many records.

 

When locating the record does not scroll until the record in uniDBGrid.


  • 0

#12 Delphi Developer

Delphi Developer

    Advanced Member

  • Moderators
  • 5177 posts

Posted 12 June 2018 - 04:30 AM

Hi,

 

When locating the record does not scroll until the record in uniDBGrid.

 

I couldn't reproduce.

 

How can we reproduce this, can you make a simple testcase for this ?!


  • 0

#13 webdev

webdev

    Member

  • uniGUI Subscriber
  • PipPip
  • 13 posts

Posted 09 July 2018 - 10:33 PM

Hi.

 

Sorry I'm late.

 

I could simulate the problem.

 

The bug has to do with the amount of records.

 

Follow test.

Attached Files

  • Attached File  Test.zip   33.04KB   4 downloads

  • 0

#14 Farshad Mohajeri

Farshad Mohajeri

    Administrator

  • Administrators
  • 10426 posts

Posted 10 July 2018 - 07:35 AM

Confirmed.

 

I will try to find a fix.


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users