EasyUI Forum

General Category => General Discussion => Topic started by: catpaw on February 15, 2017, 10:17:12 AM



Title: group datalist + master detail + Group Rows
Post by: catpaw on February 15, 2017, 10:17:12 AM
hello again, to continue with my current proyect wich is a  contacts book, I came up with this:

I have a datalist of contacts and I group the contacts with their first letter of their last name, looks like this (example):

| A                       |
| Aquaman             |
| B                       |
| Batman               |
| C                       |
| Captain America   |

then I want to be able to open a contact, and see his details like number, email, ...
so I added the master detail for the datagrid and totally works, but the formatter take away the agrupation fo datalist, and now look like this:

| + Aquaman             |
| + Batman               |
| + Captain America   |

I just need the agrupment returns, please, this my code:

Code:
<div id="dt" class="easyui-datalist" style="height:450px;" data-options="
                            url: 'retrieve/get_list_contactos.php',
                            method: 'get',
                            lines: true,
                            groupField: 'group',
                            view: detailview,
                            detailFormatter: dtFormatter,
                            onExpandRow: getDetails
                       ">
<script type="text/javascript">
function dtFormatter(index,row){
return '<div class="ddv" style="padding:5px 0"></div>';
}
function getDetails(index,row){
var ddv = $(this).datagrid('getRowDetail',index).find('div.ddv');
ddv.panel({
height:80,
border:false,
cache:false,
href:'retrieve/get_details_view.php?id_contacto='+row.id_contacto,
onLoad:function(){
$('#dt').datagrid('fixDetailRowHeight',index);
}
});
$('#dt').datagrid('fixDetailRowHeight',index);
}
</script>

there is a way to return the agrupment?
I dont want to use the Group Rows in DataGrid
I want to keep te group for datalist

thanks


Title: Re: group datalist + master detail
Post by: jarry on February 15, 2017, 06:16:00 PM
Please look at this example http://code.reloado.com/iwekaj3/edit#preview.


Title: Re: group datalist + master detail
Post by: catpaw on February 16, 2017, 07:40:45 AM
hello jarry,


I saw your example, thank you

But is just how I have now, my issue is that before I implement the master detail (datagrid), the rows were agrup with the Group DataList, after, the agrupment not showing anymore

the question here was, how I show the group functionality of datalist and keeping the master detail view?

or how to combine master detail + group rows on datalist?