EasyUI Forum
September 14, 2025, 01:23:13 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 / Datagrid(subgrid) field editor is not getting the composite data in edit mode 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);
},
2  General Category / EasyUI for jQuery / Re: Expanded datagrid-detailview & detailview has button to add multiple rows on: November 25, 2014, 05:40:54 AM
Thanks stworthy,

To list out all records, i want to make detailview should view by default when it has data. If no data i don't want show detailview. While adding(new )/editing master record only detailview show with 'Add button' with two text fields.

Could you please help me.
3  General Category / EasyUI for jQuery / Expanded datagrid-detailview & detailview has button to add multiple rows on: November 25, 2014, 04:37:10 AM
Datagrid needs to be expanded detailview(subgrid) without (+ or -) sign in the datagrid. detailview(subgrid) has 'Add Button' with two text fields. Each click on 'Add button' add text field rows in detailview same same master. detailview records should be refer to master row.
when Save/update total should process to persist(master row with detailview).

Could you please provide sample code snippet to achieve this.
Thanks in advance.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!