Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Phil on Jun 11, 2009 03:19
open dhtmlx forum
Programmatically clicking on a grid header

Hi,

For testing purposes I would like to be able to programmatically click on a grid header. I've looked through the documentation but cannot figure out a way of doing it. Is it possible to do this?

I'm using professional.

Thanks,

Phil.
Answer posted by dhxSupport on Jun 11, 2009 03:30
If you want sort grid you can use method mygrid.sortRows(col, type, order) where 
* col - index of column, by which grid need to be sorted
* type - sorting type (str,int,date), optional, by default sorting type taken from column setting
* order - sorting order (asc,des), optional, by default sorting order based on previous sorting operation
Answer posted by Phil on Jun 11, 2009 04:06
Thanks for the quick response.

As I mention, this is for testing purposes; I want to run some selenium tests that recreate clicking on headers as a real user would do. I already have a wrapper object around the dhtmlx grid onto which I have added a number of methods to help with my testing. Now I want to this add a method such as ClickHeader(<columnIndex>). However, there doesn't seem to be any way in the dhtmlx grid to programmatically click a header in the same way that you can, for example, check a cell.

I don't want to call the sortRows method directly, as the user will not directly be doing this and so the test will be invalid.
Answer posted on Jun 11, 2009 06:49
>>However, there doesn't seem to be any way in the dhtmlx grid to programmatically click a header in the same way that you can, for example, check a cell.
Yes, you are right. dhtmlxGrid hasn't appropriate method.