Auto select first row Master Grid and subgridS

QuestionsAuto select first row Master Grid and subgridS
Gaëtan asked 9 years ago

Hi,
I managed to implement the automatic row loading of sub grids when clicking on the row of the Master Grid.
I am now trying to make the first row of the Master Grid to be selected when loading the webpage – hoping to get the sub grids loaded with the relevant data.

Unfortunately, it does not work as expected.
The first row of the Master Grid gets loaded, but the Sub Grid does not report any data.
If I manually refresh of Sub Grid (via the Sub Grid toolbar), the correct data then get loaded.

I have checked Firebug and it looks like the Master ID does not get to the sub grid level on the web page get loaded…

I try to follow instructions on the following post:
https://phpgrid.desk.com/customer/portal/questions/11624713-select-first-row-in-master-on-load

Here is my current code:
http://pastebin.com/YimJsCrb

Thanks.

6 Answers
Abu Ghufran answered 9 years ago

Code looks fine, try increasing the timeout duration from 100 to 250.
setTimeout( function(){ jQuery("#list1").jqGrid('setSelection', ids[0], true); },250);

Gaëtan answered 9 years ago

Hi Abu,
In order to get something, I have to set the following to 1200 minimum.
But only the Grid02 gets updated, not Grid 03 … even if I increase to value over 1200 …

Any idea ?

Thanks

Abu Ghufran answered 9 years ago

Please check for JS error in debug console.
If your grid is online, you can email me details to check live.

Gaëtan answered 9 years ago

Hi Abu,
I hope you are well. I tried to contact you by email / message but I don't know if you got it.

Following your last message, I did check the error console … Nothing in there.

https://phpgrid.desk.com/customer/portal/questions/16283978-auto-select-first-row-master-grid-and-subgrids

1-http://192.168.1.4:8080/DEV/phpgrid/crm06.php?grid_id=list1&_search=false&nd=1462868981064&rows=20&jqgrid_page=1&sidx=cie_name+ASC%2Ccie_id&sord=asc

2- http://192.168.1.4:8080/DEV/phpgrid/crm06.php?grid_id=list2&_search=false&nd=1462868981165&rows=20&jqgrid_page=1&sidx=note_id&sord=desc

3- http://192.168.1.4:8080/DEV/phpgrid/crm06.php?grid_id=list3&_search=false&nd=1462868981217&rows=20&jqgrid_page=1&sidx=log_id&sord=desc

4- http://192.168.1.4:8080/DEV/phpgrid/crm06.php?list1&grid_id=list2&rowid=637&_search=false&nd=1462868983538&rows=20&jqgrid_page=0&sidx=note_id&sord=desc

In the console, I get the 4 above lines.
1- this is the main grid which gets loaded.

2- this is the second grid … which gets loaded but reports no data.

3- this is the third grid … same as 2-

4- this is again for the second grid … but data are then reported …

This is strange … Why the second grid gets loaded twice in order to get data … and why grid 3 gets loaded ounces reports nothing ?

Thanks
Gaëtan

Gaëtan answered 9 years ago

Hi,
Ok, I managed to make the 2 sub grids to retrieve the records by change the timeout value from 1200 to 2200. It won't work under 2200.

Why this ?

Regards

Abu Ghufran answered 9 years ago

I am unable to understand the issue, and may need remote desktop or access to grid.
Please continue this thread of direct email instead of forum.

Your Answer

12 + 2 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?