EasyUI Forum
March 28, 2024, 06:43: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: Nested Subgrid - 2nd level  (Read 4364 times)
stephenl
Newbie
*
Posts: 30


View Profile
« on: June 02, 2019, 04:24:31 AM »

Hello

The code below returns the JSON data for the 2nd level of a nested grid using url:'get_notes.php', however the respective fields on the grid are not being populated. (The subgrid header is showing OK)

Where am I going wrong ?


        <script type="text/javascript">
        var conf = {
         
            options:{
                fitColumns:true,
                columns:[[
                    {field:'Customer',title:'Acct',width:10},
                    {field:'Cus_Name',title:'Name',width:100},
                ]],
            },
         
            subgrid:{
                options:{
                    fitColumns:true,
               singleSelect:true,
               url:'get_docs.php',
                    foreignField:'Customer',
                            columns:[[
                                {field:'Doc',title:'Doc',width:6},
                        {field:'Doc_Type',title:'T',width:3,align:'center'},
                        {field:'Doc_Date',title:'Doc Date',width:10,align:'center'},
                        {field:'Due',title:'Due Date',width:10,align:'center'},
                            ]],
            },      
            
              subgrid:{
                    options:{
                    fitColumns:true,
               singleSelect:true,
               url:'get_notes.php',
                    foreignField:'Doc',
                            columns:[[
            {field:'Doc',title:'Doc',width:20},
                                {field:'Notedate',title:'Date',width:30},
                                {field:'Note',title:'Note',width:200},
                            ]]
                   }
      }
              }   
                  
       };
 
        $(function(){
            $('#dg').datagrid({
                title:'Accounts',
                width:850,
                height:450
            }).datagrid('subgrid', conf);
        });
        </script>

Thank you
Logged
stephenl
Newbie
*
Posts: 30


View Profile
« Reply #1 on: June 03, 2019, 01:31:35 PM »

Hello

I have noticed the following error, when expanding the 2nd level.....maybe this helps identify my problem

TypeError: rows is undefinedjquery.easyui.min.js:12284:13

    jQuery 14
        renderTable
        render
        _79d
        loadData
        each
        each
        loadData
        datagrid
        _882
        success
        i
        fireWith
        y
        c

Any suggestions would be appreciated

Thank you



Logged
jarry
Administrator
Hero Member
*****
Posts: 2260


View Profile Email
« Reply #2 on: June 03, 2019, 06:42:43 PM »

Please look at this example http://code.reloado.com/udemuz3/edit#preview
Logged
stephenl
Newbie
*
Posts: 30


View Profile
« Reply #3 on: June 04, 2019, 12:02:18 PM »

Hi Jarry

Thank you taking the time to reply, and confirming my code was in fact OK, this prompted me to look elsewhere...

The actual problem was the [] were missing from the returned Json data !..

Thanks again !

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!