EasyUI Forum
September 13, 2025, 12:10:27 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: is it possible to make groupView only group the item that more than 1?  (Read 9714 times)
aswzen
Sr. Member
****
Posts: 287


Indonesian

aswzen
View Profile WWW Email
« on: September 24, 2014, 12:32:02 AM »

is it possible to make groupView only group the item that more than 1?
i just wondering how to do that..
because i have only 20% items from 15000 that should be grouped and the other not ..

thanks in advance...
« Last Edit: September 24, 2014, 12:34:37 AM by Agus Sigit Wisnubroto » Logged

Regards,
Sigit

- Indonesian jEasyUI Facebook page : https://www.facebook.com/groups/jeasyuiid/
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: September 24, 2014, 03:41:51 AM »

Please describe your question in more detail.
Logged
aswzen
Sr. Member
****
Posts: 287


Indonesian

aswzen
View Profile WWW Email
« Reply #2 on: September 24, 2014, 04:31:39 AM »

just look at the pic below..


you see..that Computer and Microphone just only have 1 item..and the Lighting have 3 items like in the top picture..
and i want the table only grouped if the Item is more than 1 just like in the bottom pic..

is it possible?

thanks
Logged

Regards,
Sigit

- Indonesian jEasyUI Facebook page : https://www.facebook.com/groups/jeasyuiid/
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: September 24, 2014, 07:05:24 AM »

Please try the following code:
Code:
$('#dg').datagrid({
view:groupview,
onLoadSuccess:function(){
var state = $.data(this, 'datagrid');
var opts = state.options;
var body = state.dc.body1.add(state.dc.body2);
var groups = opts.view.groups;
$.map(groups, function(group,index){
if (group.rows.length == 1){
var g = body.children('div.datagrid-group[group-index="'+index+'"]');
g._outerHeight(0)
}
})
}
})
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!