ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: ibizlink on February 13, 2022, 06:30:05 pm

Title: Pivot with tab on modal
Post by: ibizlink on February 13, 2022, 06:30:05 pm
HI

I am trying to use Pivot with tab example on modal, but it is not activate with pivot table initially.

It is okay if activated with data tab initially but no luck for pivot table.

I use the below code and it works well with data tab but no luck for pivot table tab.

                $("#modal_lg").on("shown.bs.modal", function () {
                    pq.Grid.refresh();

                });

(I use examtly same code on the example code (Pivot with tabs))

Thanks,

Title: Re: Pivot with tab on modal
Post by: paramvir on February 14, 2022, 10:38:52 am
/** Initially **/

Please use tabModel API: https://paramquery.com/pro/api#option-tabModel

tabModel.activeId sets the active tab initially.

tabModel:{
  activeId: number
}

/** run time */

grid.Tab().activate( id ) is used to set active Tab at run time.

To refresh an active tab grid at run time:

Code: [Select]
  var Tab = grid.Tab(); //where grid is the instance of main grid.
  Tab.grid( Tab.activeTab() ).refresh();

Please check Tab API: https://paramquery.com/pro/api#method-Tab