Author Topic: Create and Destroy grid instance on Tabs  (Read 2371 times)

mewbie

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 33
    • View Profile
Create and Destroy grid instance on Tabs
« on: February 02, 2018, 02:22:36 pm »
Hello Paramvir,

sorry if it sounds trivial, but how to create and destroy grid instance based on active tab?

Code: [Select]
 
<div class="tabs">
    <ul class="tab-links">
    <li class="active"><a href="#tab1">Tab 1</a></li>
    <li><a href="#tab2">Tab 2</a></li>
    </ul>

    <div class="tab-content">
    <div id="tab1" class="tab active">
      <div id="tab1_grid"></div>
    </div>
      <div id="tab2" class="tab">
      <div id="tab2_grid"></div>
      </div>
    </div>
  </div>

I don't want to assign new variable other than grid

Code: [Select]
var grid = pq.grid("#tab1_grid", Obj);
While tab2_grid is from different table.

Thank you.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Create and Destroy grid instance on Tabs
« Reply #1 on: February 02, 2018, 07:13:36 pm »
To create, destroy, create grid.

Code: [Select]
var grid = pq.grid("#tab1_grid", Obj1);

grid.destroy(); //destroy first grid.

grid = pq.grid("#tab2_grid", Obj2);
[code]
« Last Edit: February 02, 2018, 09:24:45 pm by paramquery »