EasyUI Forum
May 05, 2024, 06:18:17 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: 'panel' undefined when refresh panel href page contain datagrid with paging  (Read 7894 times)
Aod47
Jr. Member
**
Posts: 83


View Profile
« on: July 27, 2015, 12:47:16 AM »

Chrome browser shown "Uncaught TypeError: Cannot read property 'panel' of undefined"
When I try to refresh panel onSelect Tab event.
Error occurred only href page that contain datagrid with paging.

Code:
<body>
    <div class="easyui-layout" id="viewport" fit="true">
<div id="TpConfig" class="easyui-tabs" data-options="fit:true,onSelect:refreshPanel">
<div id="TabUserCtrl" title="Users Control" data-options="href:'TabTemplate1.aspx'" style="padding:10px;"></div>
<div id="TabSystemSetting" title="System Settings" data-options="href:'TabTemplate2.aspx'" style="padding:10px;"></div>
</div>
</div>

<script type="text/javascript">
    function refreshPanel(title, index) {
        var p = $(this).tabs('getTab', index);  // get current tab
        p.panel('refresh'); // error this line
    }    
    </script>
   
</body>

Could you please advice. Many Thank
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: July 27, 2015, 01:25:26 AM »

Make sure you have created the datagrid successfully before calling 'getPager' method.
Code:
var dg = $('#dg').datagrid();  // create datagrid
var pager = dg.datagrid('getPager');
Logged
Aod47
Jr. Member
**
Posts: 83


View Profile
« Reply #2 on: July 27, 2015, 07:18:05 AM »

I tried load page 'TabTemplate2.aspx' directly. No error message.

Code:
<body>					
<table id="GridSpInventory" idField="id" class="easyui-datagrid"
data-options="
url: 'getJobs.aspx', /* present json file format */
rownumbers: false,
method: 'post',
striped: true,
pagination: true,
fit: true,
singleSelect: true
">
<thead>
<tr>
<th data-options="field:'custId',hidden:true">CUSTID</th>
<th data-options="field:'vid',hidden:true">VID</th>
<th data-options="field:'id',hidden:true" width="5%"><b>ID</b></th>
<th data-options="field:'jobNumber',align:'left',resizable:true" width="10%"><b>Job Number</b></th>
<th data-options="field:'created',align:'left',resizable:true" width="15%"><b>Date</b></th>
<th data-options="field:'brand',align:'left',resizable:true" width="10%"><b>Brand</b></th>
<th data-options="field:'regNumber',align:'left',resizable:true" width="15%"><b>License Number</b></th>
<th data-options="field:'customerName',align:'left',resizable:true" width="20%"><b>Customer</b></th>
<th data-options="field:'jobStatus',align:'left',resizable:true" width="10%"><b>Status</b></th>
<th data-options="field:'creatorName',align:'left',resizable:true" width="10%"><b>Creator</b></th>
</tr>
</thead>
</table>
</body>

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!