[slickGrid]- ScrollToRow() method

1,056 views
Skip to first unread message

Nilesh

unread,
Feb 22, 2011, 3:59:50 PM2/22/11
to SlickGrid
Hi,

Our application uses slick Grid and I am writing automation for this
web-based app using Selenium 2.0. Currently the slick grid in our app,
has only 23+ visible rows in the DOM at a time. When the user scrolls
up or down- the rows are dynamically attached to the DOM.

With Selenium, I can only work with elements that are attached to the
DOM. However in Selenium, I can run my own Javascripts. Therefore for
the rows that are _not_ visible I tried something like,
grid.scrollToRow(25) and getting an error that scrollToRow() function
does not exist. At this point, I am pretty much stuck on how to access
rows that are not attached to DOM.

Is there any provision in Javascript or slickGrid API to scroll until
the row that is not visible in the DOM?

Thanks,
-Nilesh

Michael Leibman

unread,
Feb 22, 2011, 5:05:22 PM2/22/11
to slic...@googlegroups.com
There's no such method as "scrollToRow".  Use "scrollRowIntoView".

Nilesh

unread,
Feb 23, 2011, 11:06:16 AM2/23/11
to SlickGrid
Hi Michael,
Thanks for correcting the function call. Actually calling
grid.scrollRowIntoView(490,false); works on your website-
http://mleibman.github.com/SlickGrid/examples/example1-simple.html

However the same line of javascript code complains "grid is not
defined". Then I looked at the backend slickGrid javascripts and I
found a function SlickGrid(container,data,columns,options) as opposed
to "grid = new Slick.Grid("#myGrid", data, columns, options);" that is
in your website.

Any idea on how do I get control of the slickGrid object so that I can
use scrollRowIntoView() method? I am no Javascript expert and just
started learning. Any help/pointers would be really beneficial.

Thanks,
-Nilesh

Nilesh

unread,
Feb 23, 2011, 2:38:25 PM2/23/11
to SlickGrid
I found out the object initialization and handle over the grid . Now I
can use all the API methods of slickGrid. How cool is that :)

Thank you for your help Michael.

On Feb 23, 11:06 am, Nilesh <nilesh.c...@gmail.com> wrote:
> Hi Michael,
> Thanks for correcting the function call. Actually calling
> grid.scrollRowIntoView(490,false); works on your website-http://mleibman.github.com/SlickGrid/examples/example1-simple.html

Sachin Kumar

unread,
Oct 16, 2013, 9:51:21 PM10/16/13
to slic...@googlegroups.com
Hi Nilesh,

  I am relatively new to Selenium Webdriver and would need some inputs on executed JS funtions from selenium.

  We are also automating slickgrid and would like to understand the steps of initialization and get the handle over the grid.

  If you can give a sample code piece of the steps where webdriver can access the slick grid API Funcitons, it would be great

  any help would be appreciated.

Regards,
Sachin 

prabu...@gmail.com

unread,
Feb 4, 2016, 1:36:47 AM2/4/16
to SlickGrid
Hi

I am new to SlickGrid I want to automate it.
Please help me....

Thanks in advance.....

prabu...@gmail.com

unread,
Feb 4, 2016, 1:37:58 AM2/4/16
to SlickGrid
Hi

I am new to SlickGrid I want to automate it in Selenium I don't know about slick grid.
Please help me....

Thanks in advance.....

On Wednesday, February 23, 2011 at 2:29:50 AM UTC+5:30, Nilesh wrote:

prabu...@gmail.com

unread,
Feb 4, 2016, 7:16:24 AM2/4/16
to SlickGrid
Hi please forward me the sample code to handle slick grid.
I want to automate slick grid using selenium. 

Sampath Kumar Maka

unread,
Jun 13, 2018, 5:33:16 AM6/13/18
to SlickGrid
Hi Nilesh,

I am also struck at the same point, where I am seeing the same error of Grid not defined.

Can you please kindly help me in letting me know how to initialise the grid object to use in selenium JS calls.

Thanks,
Sampath. 

On Thursday, February 24, 2011 at 1:08:25 AM UTC+5:30, Nilesh wrote:

Nilesh Kulkarni

unread,
Jun 14, 2018, 12:20:17 AM6/14/18
to slic...@googlegroups.com
Its been 7+ years since I did this, but If I recollect this, you would need to initialize the grid and use API methods.

String script = "grid = new Slick.Grid("#myGrid", data, columns, options); grid.scrollRowIntoView(490,false);"
((JavascriptExecutor)driver).executeScript(script);

Something like above

--
You received this message because you are subscribed to a topic in the Google Groups "SlickGrid" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/slickgrid/tLeq4u3sjIw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to slickgrid+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sampath Kumar Maka

unread,
Jun 15, 2018, 7:58:39 AM6/15/18
to slic...@googlegroups.com
Hi Nilesh,

Thanks alot for the email, though it has been long time you worked on this, you taking time to answer my question, speaks alot of your contribution for the community.

BTW, with regards to the solution, I tried the above but I was still getting the errors as I didnt write any functions for data, column and options, so do I need to write the js code of the slick grid in the selenium script to get it work?

Thanks,
Sampath.

--
You received this message because you are subscribed to the Google Groups "SlickGrid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to slickgrid+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages