Title: 1.5.5.5 + jquery 1.12.4 fitColumns does not work correctly in the datagrid. Post by: mittya on August 07, 2018, 10:52:56 PM 1.5.5.5 + jquery 1.12.4 does not correctly work fitColumns in the datagrid inside the layout with the right panel expanded. 1.5.5.5 + jquery 1.11.3 - ok
Title: Re: 1.5.5.5 + jquery 1.12.4 fitColumns does not work correctly in the datagrid. Post by: stworthy on August 08, 2018, 02:00:58 AM Please look at this example http://code.reloado.com/azirur3/edit#preview. It works fine.
Title: Re: 1.5.5.5 + jquery 1.12.4 fitColumns does not work correctly in the datagrid. Post by: mittya on August 10, 2018, 01:36:52 AM I fix the size of all columns except one.
1.5.5.5 + jquery-1.11.3.min.js works fine, 1.5.5.5 + jquery-1.12.x.min.js fitColumns does not work correctly in the datagrid. HTML: <body id="body-frame" class="easyui-layout"> <div data-options="region:'north'" style="height:30px;background:#cfcfcf;overflow:hidden;"> <a href="/index.php?m=9998" onclick="cookiesClear()"><img id="logo" src="/!LOGO"></a> !MENUBAR </div> <div data-options="region:'west',split:false,collapsed:true, hideExpandTool: true, expandMode: null, hideCollapsedContent: false, collapsedSize: 84, collapsedContent: function(){ return $('#mainbar'); }"> </div> <div id="rmenu_panel" data-options="region:'east',split:true,title:'!USER'" style="width:350px;"> <div class="easyui-accordion" data-options="fit:true" style="border: none;"> !SRCH <div data-options="selected:true" style="overflow:auto;padding:3px;"> !RMENU </div> <div data-options="title:' ', iconCls:'!SUPERADMIN', collapsed:false, collapsible:false, tools:[ !TOOLS { iconCls:'icon-opml', handler:function(){ document.location.replace('/index.php?ct='+st); } } ]" style="width:297px;height:180px;"> <div id="cc"></div> </div> </div> </div> <div data-options="region:'center',title:' -- <font color=OrangeRed><big>!DATE</big></font> -- <font color=Purple>!NAV</font>'"> <div id="main-frame" class="easyui-layout" data-options="fit:true"> <div data-options="region:'center',split:true" style="overflow:hidden;"> !MAIN </div> <div id="info_panel" data-options="region:'south',split:false,collapsed:true,collapsedSize:0," style="overflow:hidden;"> <div class="easyui-layout" data-options="fit:true"> <div data-options="region:'center',split:false" style="overflow:hidden;"> !INFO </div> <div data-options="region:'west',split:false,collapsed:true, hideExpandTool: true, expandMode: null, hideCollapsedContent: false, collapsedSize: 50, collapsedContent: function(){ return $('#infobar'); }"> </div>; </div> </div> </div> </div> <div id="footer" data-options="region:'south'"> ©2008-2018 | <a href="http://www.lebed.info" target="_blank">http://www.lebed.info</a> | Дмитро Лебедь <span id="bench">!BENCH сек</span> </div> <div id="mainbar" style="padding:1px"> !MBAR </div> <div id="infobar" style="padding:2px"> !IBAR </div> !FORM </body> JS: $('#main').datagrid({ url:'/app/sklad/seeds/get_main.php', rownumbers:true, singleSelect:true, fitColumns:true, pagination:false, view:groupview, groupField:'month', nowrap:false, idField:'pk', groupFormatter:function(value,rows){ var date = new Date(value); var n = 0; var dt_summ = 0; var kt_summ = 0; if (rows[0].rmenu == undefined) { return '<div style="width:100%;"><table style="width:100%;"><tr><td width=150px>' + date.format('mmmm') + ' (' + rows.length + ' док.)'+ '</td></tr></table></div>'; } else { while (n < rows.length) { if (rows[n].dt != rows[n].kt) { dt_summ = +dt_summ + +rows[n].dt; kt_summ = +kt_summ + +rows[n].kt; } var saldo = +rows[n].saldo; n ++; } return '<div style="width:100%;"><table style="width:100%;"><tr><td width=150px>' + date.format('mmmm') + ' (' + rows.length + ' док.)'+ '</td><td style="text-align:right;width:60px;padding-right:3px;">наявність:'+ '</td><td style="text-align:left;color:Navy;">'+accounting.formatNumber(saldo, 2)+ '</td><td style="text-align:right;width:150px;color:darkGreen;">дт: '+accounting.formatNumber(dt_summ, 2)+ '</td><td style="text-align:right;padding-right:77px;width:97px;color:Indigo;">кт: '+ accounting.formatNumber(kt_summ, 2)+ '</td></tr></table></div>'; } }, columns:[[ {field:'ddate',title:'дата',width:95,fixed:true}, {field:'corn_id',width:26,fixed:true, formatter:function(value, row){ switch(row.corn_id) { case '1010001': return '<div class="icon-wheat"> </div>'; break; case '1010002': return '<div class="icon-barley"> </div>'; break; case '1010003': return '<div class="icon-proso"> </div>'; break; case '1020001': return '<div class="icon-peas"> </div>'; break; case '1020002': return '<div class="icon-chickpea"> </div>'; break; case '1030001': return '<div class="icon-rape"> </div>'; break; case '1030002': return '<div class="icon-sunflower"> </div>'; break; } } }, {field:'seeds',title:'сорт (репр.) рік, од.вим.',width:250,fixed:true}, {field:'description',title:'походження / призначення',width:500, editor:{ type:'textbox', options:{required:true,validType:['length[0,100]']} } }, {field:'dt',title:'дт',width:110,fixed:true,align:'right', styler: function(index,row){ if (row.dt == row.kt) { return 'font-style: italic; color: DarkBlue;'; } else if (row.dt != row.kt && row.dt == 0) { return 'font-weight: bold; color: darkRed;'; } else if (row.dt != row.kt && row.kt == 0) { return 'font-weight: bold; color: darkGreen;'; } }, formatter:function(value, row){ if (row.dt == 0) { return '-'; } else { return accounting.formatNumber(row.dt, 2); } } }, {field:'kt',title:'кт',width:110,fixed:true,align:'right', styler: function(index,row){ if (row.dt == row.kt) { return 'font-style: italic; color: DarkBlue;'; } else if (row.dt != row.kt && row.dt == 0) { return 'font-weight: bold; color: darkRed;'; } else if (row.dt != row.kt && row.kt == 0) { return 'font-weight: bold; color: darkGreen;'; } }, formatter:function(value, row){ if (row.kt == 0) { return '-'; } else { return accounting.formatNumber(row.kt, 2); } } }, {field:'action',title:'',width:70,fixed:true,align:'center', formatter:function(value,row,index){ if (!row.id || ecl != 1) {return row.action;} if (row.editing && row.st){ var s = '<a href="javascript:void(0)" style="text-decoration: none;" onclick="saveRow(this)"><img src="/_ui/easyui/icons/filesave.png" style="padding: 4px 8px 0 0;"></a>'; var c = '<a href="javascript:void(0)" style="text-decoration: none;" onclick="cancelRow(this)"><img src="/_ui/easyui/icons/cancel.png"></a>'; return s+c; } else { if (row.st == 1){ var e = '<a href="javascript:void(0)" style="text-decoration:none;" onclick="editRow(this)"><img src="/_ui/easyui/icons/pencil.png" style="padding: 4px 8px 0 0;"></a>'; var d = '<a href="javascript:void(0)" style="text-decoration: none;" onclick="hideRow(this)"><img src="/_ui/easyui/icons/no.png" style="padding: 4px 0 0 0;"></a>'; return e+ '<span title="' + row.id + ': (' + row.uid + ') ' + row.tm + '" class="easyui-tooltip" data-options="position:\'left\'">' + d + '</span>'; } else { var e = '<img src="/_ui/easyui/icons/blank.gif" style="padding: 0 6px 0 0;">'; var d = '<a href="javascript:void(0)" style="text-decoration: none;" onclick="deleteRow(this)"><img src="/_ui/_icon/16/cross-script.png" style="padding: 4px 0 0 0;"></a>'; return e+ '<span title="' + row.id + ': (' + row.uid + ') ' + row.tm + '" class="easyui-tooltip" data-options="position:\'left\'">' + d + '</span>'; } } } } ]], onSelect: function(index, row) { cancelEdit(this); }, onLoadSuccess:function(){ $(this).datagrid('getPanel').find('.easyui-tooltip').tooltip({ showDelay: 5000 }); }, onBeforeEdit:function(index,row){ var fields = $(this).datagrid('getColumnFields'); var dsk = $(this).datagrid('getColumnOption', fields[3]); var dt = $(this).datagrid('getColumnOption', fields[4]); var kt = $(this).datagrid('getColumnOption', fields[5]); if (row.dt == row.kt) { dsk.editor = null; dt.editor = null; kt.editor = {type:'numberbox',options:{required:true, precision:2}}; } else if (row.dt == 0) { dt.editor = null; kt.editor = {type:'numberbox',options:{required:true, precision:2}}; } else if (row.kt == 0) { dt.editor = {type:'numberbox',options:{required:true, precision:2}}; kt.editor = null; } row.editing = true; $(this).datagrid('refreshRow', index); }, onEndEdit: function(index,row,changes){ if (row.dt != 0 && changes.kt != undefined) { row.dt = changes.kt; } $(this).datagrid('refreshRow', index); }, onAfterEdit:function(index,row){ row.editing = false; $(this).datagrid('refreshRow', index); }, onCancelEdit:function(index,row){ row.editing = false; $(this).datagrid('refreshRow', index); }, }); Title: Re: 1.5.5.5 + jquery 1.12.4 fitColumns does not work correctly in the datagrid. Post by: stworthy on August 10, 2018, 06:40:14 PM 1. You should set a initialised width for the west panel.
Code: <div data-options="region:'west',split:false,collapsed:true,width:84, 2. Set the 'fit' property for the datagrid. Code: $('#main').datagrid({ Title: Re: 1.5.5.5 + jquery 1.12.4 fitColumns does not work correctly in the datagrid. Post by: mittya on August 16, 2018, 11:53:22 PM Thanks, it works well. Thank you!
|