EasyUI Forum
May 22, 2024, 05:12:23 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: datagrid won't group  (Read 3389 times)
gib65
Newbie
*
Posts: 29


View Profile Email
« on: June 15, 2017, 12:11:27 PM »

Hello,

I'm trying to implement group on my DataGrid but it's not working.

Here's my html:

<div>
    <table id="easyuiDataGrid" style="width: 800px;"></table>
</div>

Here's my javascript:

$('#easyuiDataGrid').datagrid({
            columns: [[

      { field: 'label', width: 200 },
                { field: 'value', width: 500, },
                { field: 'rank', width: 100 }
            ]],
       data: [
      { label: '<b>1st Safeguard</b>', value: 'BPCS-CF-AAH-601B...', rank: 3},
                { label: '<b>2nd Safeguard</b>', value: 'ROUND - Daily lab rounds.', rank: 2},
                { label: '<b>1st Safeguard</b>', value: 'Other - Methanol injection...', rank: 1},
                { label: '<b>2nd Safeguard</b>', value: 'BPCS - CF-AAH-601B...', rank: 1 },
                { label: '<b>1st Safeguard</b>', value: 'ROUND - Daily lab rounds.', rank: 2 },
                { label: '<b>2nd Safeguard</b>', value: 'Other - Methanol injection...', rank: 3 },
            ],
            fitColumns: true,
            groupField: 'label',
            view: groupview
        });

If I take out "view: groupview" the grid doesn't group. If I leave it in, the grid doesn't render. I'm not sure what view or groupview is or why it's necessary.

Can anyone see the problem?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: June 16, 2017, 04:20:13 AM »

Please look at this example https://www.jeasyui.com/demo/main/index.php?plugin=DataGrid&theme=default&dir=ltr&pitem=Group%20Rows%20in%20DataGrid&sort=
Logged
gib65
Newbie
*
Posts: 29


View Profile Email
« Reply #2 on: June 16, 2017, 07:42:39 AM »

That works perfectly. Not sure why I wasn't able to get it to work before. Will customize this grid and see if I can make it do what I want. 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!