EasyUI Forum
September 14, 2025, 08:46:43 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  General Category / EasyUI for jQuery / Re: create columns in SubGrid from a JSONObject. on: November 05, 2015, 06:25:39 PM
Hello administrator,

Many thanks for your kind help.
It works perfectly.   Smiley Smiley Smiley


Thanks & Regards,
Bin
2  General Category / EasyUI for jQuery / create columns in SubGrid from a JSONObject. on: November 05, 2015, 05:03:29 AM
hello all,

I am new to easyui and encounter  a problem with DataGrid when trying to create columns from a JSONObject in SubGrid.

Here's my Java script:

onExpandRow: function(index,row){
                var ddv = $(this).datagrid('getRowDetail',index).find('table.ddv');
                ddv.datagrid({
                    url:'FFDDR!rowExpend?s_PID='+row.ProtocolId,
                    loadMsg:'Loading ...',
                    fitColumns:true,
                    singleSelect:true,
                    rownumbers:true,
                    onResize:function(){
                        $('#dg').datagrid('fixDetailRowHeight',index);
                        $('#dg').datagrid('fixRowHeight',index);
                    },
                    onLoadSuccess:function(data, param){
                        ddv.datagrid({
                            columns:[data.columns]                       //Columns are created, but NOT shown in SubGrid
                        });
                        ddv.datagrid("loadData", data.rows);        //Data can be loaded to table and will show in SubGrid
                        setTimeout(function(){                                  
                            $('#dg').datagrid('fixDetailRowHeight',index);
                            $('#dg').datagrid('fixRowHeight',index);
                        },0);
                    }
                });

[data.columns] looks like this:
"columns":[{"field":"sequence_nr","title":"sequence_nr","width":100},{"field":"kind_of_test","title":"kind_of_test","width":100}]
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!