EasyUI Forum
October 03, 2025, 02:04:41 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: Easyui datagrid groupview  (Read 27744 times)
hjzhbb7758
Jr. Member
**
Posts: 84


View Profile Email
« on: May 19, 2013, 08:28:32 AM »

中文  : Easyui datagrid groupview 如何控制单击如图地方,触发展开

English : Easyui datagrid groupview . How to control click Figure triggered expand
« Last Edit: May 21, 2013, 02:35:44 AM by hjzhbb7758 » Logged
hjzhbb7758
Jr. Member
**
Posts: 84


View Profile Email
« Reply #1 on: May 21, 2013, 02:39:33 AM »

anybody here ? everyone can answer my question
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #2 on: May 21, 2013, 03:07:54 AM »

Try code below:
Code:
$('#dg').datagrid({
view:groupview,
onLoadSuccess:function(){
var dg = $(this);
dg.datagrid('getPanel').find('div.datagrid-view2 div.datagrid-group').unbind().bind('click',function(){
var index = $(this).attr('group-index');
dg.datagrid('expandGroup', index);
});
}
});
Logged
cp_Burn
Newbie
*
Posts: 4


View Profile Email
« Reply #3 on: May 21, 2013, 09:24:16 AM »

You can do something with onExpandRow:

Code:
$(function(){	
$('#dg').datagrid({
view: detailview,
onExpandRow: function(index,row){
                                                //What you want to do after click in the figure
alert('Hey there =p');
}
});
}
Logged
hjzhbb7758
Jr. Member
**
Posts: 84


View Profile Email
« Reply #4 on: May 22, 2013, 01:51:50 AM »

You can do something with onExpandRow:

Code:
$(function(){	
$('#dg').datagrid({
view: detailview,
onExpandRow: function(index,row){
                                                //What you want to do after click in the figure
alert('Hey there =p');
}
});
}

group view, you see?
Logged
hjzhbb7758
Jr. Member
**
Posts: 84


View Profile Email
« Reply #5 on: May 22, 2013, 03:50:11 AM »

Try code below:
Code:
$('#dg').datagrid({
view:groupview,
onLoadSuccess:function(){
var dg = $(this);
dg.datagrid('getPanel').find('div.datagrid-view2 div.datagrid-group').unbind().bind('click',function(){
var index = $(this).attr('group-index');
dg.datagrid('expandGroup', index);
});
}
});

onLoadSuccess:function(){
var dg = $(this);
dg.datagrid('getPanel').find('div.datagrid-view2 div.datagrid-group').unbind().bind('click',function(){
var index = $(this).attr('group-index');
var group = dg.datagrid('getPanel').find('div.datagrid-group[group-index="'+index+'"]');
var expander = group.find('span.datagrid-row-expander');
if (expander.hasClass('datagrid-row-expand')){
dg.datagrid('expandGroup', index);
}else{
dg.datagrid('collapseGroup', index);
}
});

thanks for your help .
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!