EasyUI Forum
May 02, 2024, 02:13:13 AM *
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(subgrid) field editor is not getting the composite data in edit mode  (Read 4028 times)
harik
Newbie
*
Posts: 3


View Profile
« on: December 03, 2014, 11:43:00 PM »

I am unable to display composite data in text field in edit mode for subgrid. In the below example json, subgrid iterates "categories" data and in edit mode editor is not displaying the "categoryClaim.description" value. Could you please suggest me which editor is satisfies my requirement to get data in edit mode of text fields like composite values "categoryClaim.description".

Example json:
------------

row= {"id":1,"reference":"refer1","description":"Descr 3","details":"Details 3","personName":"Person 3","hyperlink":"Hlink 3","active":true,"categories":[{"id":1,"description":"Category 1","masterId":1,"active":true,"categoryClaim":{"id":3,"description":"Claims 1","categoryId":1}},{"id":2,"description":"Category 2","masterId":1,"active":true,"categoryClaim":{"id":2,"description":"Claims 4","categoryId":2}}]}


my subgrid looklike:
------------------

view : detailview,
detailFormatter : function(index,row) {
return '<div style="padding:2px"><table class="subdg"></table></div>';
},
onExpandRow: function(index, row){                         
   var subdg = $(this).datagrid('getRowDetail',index).find('table.subdg');
   subdg.datagrid({
   data : row,
   method : "get",
   loadFilter: function(row){   
     return {
      total: row.categories.length,
      rows: row.categories
     };
   },
   fitColumns:true,
   singleSelect:true,
   rownumbers:true,
   loadMsg:'',
   height:'auto',   
   columns:[[
          {field : "id",hidden : true},
          {field:'description',title:jQuery.i18n.prop("js.eipscitation.columns.category"),width:30,         
           editor:{
            type:'validatebox',
            options:{
            required:true
            }
           }

          },
          {field:'categoryClaim.description',title:jQuery.i18n.prop("js.eipscitation.columns.claims"),width:30,
           formatter : function(value, row, index) {       
            return row.categoryClaim.description;           
           },
           editor:{
            type:'validatebox',
            options:{
            required:true
            }
           }

          }         
          ]],
          onResize:function(){
           self.dg.datagrid('fixDetailRowHeight',index);
          },
          onLoadSuccess:function(){
           setTimeout(function(){
            self.dg.datagrid('fixDetailRowHeight',index);
           },0);
          }
   });
   self.dg.datagrid('fixDetailRowHeight',index);
},
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!