Author Topic: Detail grid with tabs and first tab doesn't expand  (Read 3842 times)

Soumya

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 23
    • View Profile
Detail grid with tabs and first tab doesn't expand
« on: December 20, 2014, 02:06:52 am »
Detail Grid with tabs and the first tab doesn't expand on expanding the arrow to expand. It expands when revisiting first tab after visiting another tab.

I have the code

 $detail.find(".pq-tabs").tabs().on("tabsactivate", function (evt, ui)
                    {
                        $contactsgrid.pqGrid("refreshView");
                        if (ui.newPanel.is("#contacts")) {
                            $contactsgrid.pqGrid("refresh");
                        }
                        if (ui.newPanel.is("#holdings")) {
                            $holdingsgrid.pqGrid("refresh");
                        }
                        if (ui.newPanel.is("#comments")) {
                            $commentsgrid.pqGrid("refresh");
                        }
                        if (ui.newPanel.is("#documents")) {
                            $documentsgrid.pqGrid("refresh");
                        }
                    });

but contactsGrid doesn't expand when hit the arrow to expand .

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Detail grid with tabs and first tab doesn't expand
« Reply #1 on: December 23, 2014, 12:36:13 am »
The grid can't layout properly when its ancestor is an orphan node or is hidden.

In detailModel.init callback, $detail is an orphan node and also ancestor of inner grid until it's appended to the main grid.

It can be corrected by initializing the inner grid at a later time with a setTimeout when the orphan node is appended to the main grid.

http://paramquery.com/pro/demos/detail

Soumya

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Detail grid with tabs and first tab doesn't expand
« Reply #2 on: January 13, 2015, 08:24:03 pm »
Thank you