EasyUI Forum
September 14, 2025, 03:28:01 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 remote on a 'combogrid'  (Read 19526 times)
evertonsena
Newbie
*
Posts: 11


View Profile Email
« on: April 19, 2012, 12:43:23 PM »

How to filter in a remote 'combogrid' merging with the 'queryParams'?

I thank you!
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: April 19, 2012, 06:31:18 PM »

Set 'mode' property to 'remote' to make the combogrid be able to filter data on remote server. At the remote filter mode, the text users typed will be sent to server as a parameter named 'q'. If the 'queryParams' of grid is defined, it will also be sent to server. Write some code to retrieve the 'q' parameter and then return some new data set to the browser:

Code:
String q = request.getParameter("q");
// do some query from database
// return data set
Logged
evertonsena
Newbie
*
Posts: 11


View Profile Email
« Reply #2 on: April 24, 2012, 02:02:13 PM »

thanks for the answer! Smiley

The point is that 'queryParams' defined on the grid is not passed to the server. Only the parameters 'q', 'page' and 'rows' are sent.

Understand me? Huh
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: April 25, 2012, 12:38:33 AM »

Try the following code to fix this issue:

Code:
(function($){
var oldQuery = $.fn.combogrid.defaults.keyHandler.query;
$.fn.combogrid.defaults.keyHandler.query = function(q){
var target = this;
var opts = $(target).combogrid('options');
var grid = $(target).combogrid('grid');
grid.datagrid('options').onBeforeLoad = function(param){
if (opts.onBeforeLoad.call(target, param) == false) return false;
$.extend(param, opts.queryParams);
}
oldQuery.call(this, q);
}
})(jQuery);
Logged
evertonsena
Newbie
*
Posts: 11


View Profile Email
« Reply #4 on: April 25, 2012, 07:03:28 AM »

Perfect! It worked perfectly! Thanks for your quick response and taking advantage of the space you want congratulation by the excellent work. I use to develop a project for my learning and I meet 100% right. Follow the example of the application using almost all components: www.evertonsena.com/login

 Cheesy  Grin Cheesy
Logged
dearsh
Newbie
*
Posts: 16

arif_yes06
View Profile Email
« Reply #5 on: August 10, 2013, 11:56:39 PM »

how to use that code ?
I have problem with combogrid filter in mode remote. The combogrid just view form tabel but failed to filter.
i think the problem is params not send.
I was download and try file demo easyui-form5-demo but failed to filter data like in demo online.

i don't know where is the problem. Please help me.

Thx
dearsh jaki
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!