EasyUI Forum
April 29, 2024, 06:20:10 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: Change Total\Footer during Filter  (Read 12188 times)
ahybits
Newbie
*
Posts: 26


View Profile
« on: October 22, 2015, 12:11:06 PM »

Hi,

I would like a method\suggestion on how to update the totals (either in a footer or some other place on the page) of the values shown after a filter has been used\set

Regards,
A
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 22, 2015, 08:12:13 PM »

You can call 'reloadFooter' method to update the footer rows with any data.
Code:
$('#dg').datagrid({
showFooter:true,
onLoadSuccess: function(data){
$(this).datagrid('reloadFooter', [
{name: 'name1', salary: 60000}
]);
}
});
Logged
ahybits
Newbie
*
Posts: 26


View Profile
« Reply #2 on: October 23, 2015, 11:08:14 AM »

Thanks, but interesting, IF I have both showFooter and enableFilter, I only see the filter not the footer (having jsut showFooter to true, i see the footer)

Also, just for a clarification, if I use the filter, will the parameter of 'data' within onLoadSucecss only show the values filtered?
Logged
ahybits
Newbie
*
Posts: 26


View Profile
« Reply #3 on: October 26, 2015, 01:10:05 PM »

Any ideas / confirmation on that data?

When i attempt that, i always get all data, not the filtered data
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #4 on: October 26, 2015, 07:21:24 PM »

The 'onLoadSuccess' event fires when data is loaded successfully. When you filter the datagrid, only the filtered data is loaded. Please refer to this example http://jsfiddle.net/4L0qjbys/
Logged
ahybits
Newbie
*
Posts: 26


View Profile
« Reply #5 on: October 28, 2015, 03:08:38 PM »

Awesome, got it working with your help; 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!