EasyUI Forum
April 30, 2024, 12:52:55 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: datagrid + getColumnFields + getFilterRules  (Read 6155 times)
rezzonico
Full Member
***
Posts: 182


View Profile
« on: September 30, 2016, 12:51:05 AM »

Hi all,

I have a datagrid with enableFilter e pagination.
All works as expected.

I am searching for a solution in order to print all the selected records and not only the records on the current page. Therefore reading the content of the displayed records, with $(this).datagrid('getRows'), is not a solution.

What I am writing is a javascript that call a program (with ajax) and pass the "datagrid url" and all the "filter rules".
The called program will then do a "SELECT" and send all records to the server printer spooler.

I am able the read the datagrid url with $(this).datagrid('options').url
I am able to read the column fields with $(this).datagrid('getColumnFields')
I am able to read the filter values with $(this).datagrid('getFilterRules')

... and pass these parameters to the program.

Is this the correct approach ?
Perhaps there is a quick solution ?

Regards
Miche
« Last Edit: September 30, 2016, 04:56:06 AM by rezzonico » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 01, 2016, 09:39:02 PM »

That is the way to retrieve rows in server side. The code below shows how to retrieve these rows in client side.
Code:
function getFilteredRows(dg){
    var opts = dg.datagrid('options');
    var src = dg.data('datagrid').filterSource;
    var data = opts.filterMatcher.call(dg[0], src);
    return data;
}
Logged
rezzonico
Full Member
***
Posts: 182


View Profile
« Reply #2 on: October 04, 2016, 12:58:18 AM »

Thanks a lot !

Regards
Miche
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!