EasyUI Forum
September 14, 2025, 02:30:38 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: Filter Datagrid  (Read 10102 times)
NortT
Newbie
*
Posts: 18


View Profile Email
« on: December 20, 2017, 03:02:01 AM »

Hello, I tried to use filter with my datagrid and I have got an error:
Code:
jquery.easyui.min.js:10816 Uncaught TypeError: $.fn.datagrid.methods[_7cc] is not a function
    at m.fn.init.$.fn.datagrid (jquery.easyui.min.js:10816)
    at HTMLDocument.<anonymous> ((index):35)
    at j (jquery.min.js:2)
    at Object.fireWith [as resolveWith] (jquery.min.js:2)
    at Function.ready (jquery.min.js:2)
    at HTMLDocument.J (jquery.min.js:2)

How can I solve this problem?

I tried to use this source codehttps://www.jeasyui.com/demo/main/index.php?plugin=DataGrid&theme=default&dir=ltr&pitem=DataGrid%20Filter%20Row but it doesn't work in my browser.

The 35th string is
Code:
dg.datagrid('enableFilter', [{
Logged
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #1 on: December 20, 2017, 06:48:51 AM »

Please download the filter extension from https://www.jeasyui.com/extension/datagrid_filter.php
Logged
NortT
Newbie
*
Posts: 18


View Profile Email
« Reply #2 on: December 20, 2017, 07:50:10 PM »

Hi Jarry, it works, thank you!
Logged
NortT
Newbie
*
Posts: 18


View Profile Email
« Reply #3 on: December 20, 2017, 08:45:45 PM »

Hi again!
The filter works fine but I can't get all the rows from the datagrid. In total I have about 2500 rows, if I apply the filter, I can get rows appeared after I filtered the table, but I can't get all the rows. I use the following code to get the rows:
Code:
var data = $('#productTable').datagrid('getData');
Is it possible to get all the rows?

For example, I need to get the total sum in the specified column, I do it like this:
Code:
function getAllRows(){
var data = $('#productTable').datagrid('getData');
return data.firstRows;
}

var rows = getAllRows();
var sum = 0.0;
for(var i=0; i<rows.length; i++){
sum += parseFloat(rows[i]['total']);
}

The other problem is that if I need to edit a row, I recieve inside the onDblClickRow:function(index, target) index which is == 1300 for example, but I have 100 rows after I applied a filter, consequently, if I try to get editors of this row in the onBeginEdit

Code:
onBeginEdit:function(rowIndex) {
     var editors = $(this).datagrid('getEditors', rowIndex);
}
I have an error, because there is no such a row with the specified index in the table.

P.S. I use view: scrollview with my datagrid.
« Last Edit: December 20, 2017, 09:06:31 PM by NortT » 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!