|
Title: merge more than one field? Post by: jaimi on February 04, 2015, 04:44:02 AM I want to merge several fields within a row, not only the id-field (first).
this is my grid: I choose OLT31A004T_KEY as id-field, the one witch is merged. But I want to include 'OLT30A001T_KEY_S too. How to? THX, Jaimi $('#edgZuchtperiode').edatagrid({ title : 'Zucht-Periode' ,iconCls:'icon-pferd' ,width:'100%' ,height:'auto' ,collapsible:'true' ,columns:[[ {field:'OLT31A004T_KEY',title:'ZuchtPeriodeKey',width:080,sortable:'true'/*,hidden:'true'*/} //,{field :'OLT30A001T_KEY_S',title:'StuteKey',width:080,sortable:'true'/*,hidden:'true'*/} ,{field :'OLT30A001T_KEY_H',title:'HengstKey',width:080,sortable:'true'/*,hidden:'true'*/} //,{field :'OLT30A001T_KEY_F',title:'FohlenKey',width:080,sortable:'true'/*,hidden:'true'*/} //,{field :'ZUP_UELN_F',title:'FohlenUELN',width:240,sortable:'true'} //,{field :'ZUP_BEG',title:'Beginn',width:130,sortable:'true'} //,{field :'ZUP_END',title:'Ende',width:200,sortable:'true'/*,hidden:'true'*/} //,{field :'ZUP_ANZ_BED',title:'Anzahl',width:200,sortable:'true'} ,{field :'BED_DAT',title:'Datum',width:80,sortable:'true'} ,{field :'ZUV_DES',title:'Beschreibung',width:100,sortable:'true'} ,{field :'CBE_GER',title:'CBE_GER',width:100,sortable:'true'} ]] ,//columns toolbar : '#tobZuchtperiode', url : 'zuchtperiode.act.php?frm=frmZUP&act=T&prk=' + vPRK, remoteSort : 'true', idField : 'OLT31A004T_KEY', queryParams : {sort: 'ZUP_BEG', order: 'DESC'}, //rownumbers : 'false', singleSelect: 'true', pagination : 'true', pageSize : 30, pageList : [20,30,40,50], pagePosition: 'top', destroyMsg : { norecord:{title:'Hinweis', msg: 'Es wurde kein Satz ausgewählt.' }, confirm :{title:'Bestätigung', msg: 'Klicken Sie Ok, um die Zuchtperiode zu löschen.' } }//destroyMsg ,onLoadSuccess:function(data){ merges = new Array(); var rowsLength = data.rows.length; if (rowsLength > 0){ var curRow, firstRow = data.rows[0], vZUP, counter = 0; for (var rowIndex = 0; rowIndex <= rowsLength; rowIndex++){ if (rowIndex < rowsLength) {curRow = data.rows[rowIndex];} if (rowIndex == rowsLength || curRow.OLT31A004T_KEY != vZUP){ merges[merges.length] = {"id":vZUP, "index":rowIndex-counter, "rowspan":counter}; firstRow = curRow; counter = 1; } else {counter++;}//if vZUP = curRow.OLT31A004T_KEY; }//for }//if for(var i=0; i<merges.length; i++) $('#edgZuchtperiode').datagrid('mergeCells',{ field:'OLT31A004T_KEY', index: merges.index, rowspan:merges.rowspan }); $.messager.show({ title:'Info' ,width:300 ,height:100 ,timeout:5000 ,msg: data.total + ' Zuchtperioden wurden geladen' }); } });//edatagrid |