EasyUI Forum
October 10, 2024, 10:53:43 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Datagrid: Enable Filter giving error  (Read 10664 times)
rangaNadha
Jr. Member
**
Posts: 50


View Profile
« on: August 02, 2015, 03:47:19 AM »

Hi,

I am trying to enable the filters for the datagrid. Using below code.
dataTable = $('.easyui-datagrid');
dataTable.datagrid('enableFilter');

I am facing the below error.
$.fn.datagrid.methods[_6ea]

Thanks in advance.
Logged
jarry
Administrator
Hero Member
*****
Posts: 2274


View Profile Email
« Reply #1 on: August 02, 2015, 05:41:05 PM »

You have to create the datagrid component before calling methods.
Code:
dataTable.datagrid({...});  // create datagrid
dataTable.datagrid('enableFilter');
Logged
rangaNadha
Jr. Member
**
Posts: 50


View Profile
« Reply #2 on: August 03, 2015, 07:28:00 AM »

In HTML:
<table id="usersTable" class="easyui-datagrid work_table work_table1" style="width: 100%; height: 98% !important"
            sortName="employeeNo" sortOrder="asc" rownumbers="false" pagination="true"
            data-options="singleSelect:true, onDblClickRow:userManagement.getDataById" url="userList.htm">
            <thead>
               <tr>
                  <th field="employeeNo" width="15%" sortable="true"><spring:message code="label.fuelmanagement.administration.employeeNo"/></th>
                        <th field="userId" width="12%" sortable="true" ><spring:message code="label.fuelmanagement.administration.userId"/></th>
                        <th field="userFName" width="10%" sortable="true" ><spring:message code="label.fuelmanagement.administration.userFName"/></th>
                        <th field="userMName" width="15%" sortable="true" ><spring:message code="label.fuelmanagement.administration.userMName"/></th>
                        <th field="userLName" width="15%" sortable="true" ><spring:message code="label.fuelmanagement.administration.userLName"/></th>
                  <th field="userRank" width="10%" sortable="true" ><spring:message code="label.fuelmanagement.administration.userRank"/></th>
                  <th field="englishTrade" width="10%" sortable="true"><spring:message code="label.fuelmanagement.administration.englishTrade"/></th>
                  <th field="userStatus" width="15%" sortable="true" ><spring:message code="label.fuelmanagement.administration.status"/></th>
               </tr>
            </thead>
            
         </table>

In JavaScript:
dataTable = $('.easyui-datagrid');
dataTable.datagrid('enableFilter');
Logged
jarry
Administrator
Hero Member
*****
Posts: 2274


View Profile Email
« Reply #3 on: August 03, 2015, 07:36:32 AM »

Before calling the 'enableFilter' method, please include the 'datagrid-filter.js' file to your page. This file can be downloaded from http://www.jeasyui.com/extension/datagrid_filter.php. For more information please refer to this example http://www.jeasyui.com/demo/main/index.php?plugin=DataGrid&theme=default&dir=ltr&pitem=DataGrid%20Filter%20Row
Logged
rangaNadha
Jr. Member
**
Posts: 50


View Profile
« Reply #4 on: August 03, 2015, 08:31:40 PM »

I already included the /jquery.easyui.min.js file in our jsp.
I think it will contain the datagrid.js code also.
Correct me if i am wrong.
Logged
zolotoy
Jr. Member
**
Posts: 89


View Profile Email
« Reply #5 on: August 10, 2015, 09:09:35 AM »

Were you able to figure it out? I too am getting the same error. Do you have pagination enabled?

Thanks
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!