Show Posts
|
Pages: [1] 2 3 4
|
2
|
General Category / EasyUI for jQuery / Re: propertygrid, updateRow and getChanges problem
|
on: July 29, 2015, 02:26:12 AM
|
The 'getChanges' method reruns only those rows where the user has edited by calling 'beginEdit' and 'endEdit' methods. The 'updateRow' method does not affect the result set of the 'getChanges' method.
For me this seems like a bug... The same thing happens when trying to append a row to treegrid, example http://www.jeasyui.com/easyui/demo/treegrid/editable.htmlvar node = {"id":11,"name":"Marketing","persons":5,"begin":"4/1/2010","end":"5/1/2010","progress":40}; $('#tg').treegrid('append',{data:[node]}); $('#tg').datagrid('getChanges','inserted'); // returns empty array $('#tg').treegrid('getChanges','inserted'); // this does not work either, empty array
I have to force it like this: $('#tg').data().datagrid.insertedRows.push(node); No matter if I call beginEdit, endEdit. With datagrid appendRow the getChanges method returns correct values, with updateRow does not.
|
|
|
3
|
General Category / Bug Report / Re: Datebox okText
|
on: July 21, 2015, 01:43:43 AM
|
Maybe it should be in $.fn.datetimebox.defaults only and not to mention in datebox documentation at all because it can't be used there. But thanks for answer.
|
|
|
8
|
General Category / EasyUI for jQuery / Re: Datagrid enableFilter performance problem
|
on: April 08, 2015, 02:53:59 AM
|
Another example of wrong usage of jQuery in easyui.min.js is the setIcon method of the menu component, affects to filter initialization as well setIcon:function(jq,_418){ return jq.each(function(){ $(_418.target).children("div.menu-icon").remove(); if(_418.iconCls){ $("<div class=\"menu-icon\"></div>").addClass(_418.iconCls).appendTo(_418.target); } });
Could be setIcon:function(jq,_418){ $(_418.target).children("div.menu-icon").remove(); $('<div class="menu-icon ' +_418.iconCls+'"></div>').appendTo(_418.target); }
Effect is a few tenths of second.
|
|
|
9
|
General Category / EasyUI for jQuery / Re: Datagrid enableFilter performance problem
|
on: March 30, 2015, 05:09:32 AM
|
It seems that also the doFilter method is taking a long time, at least if using remote filtering because it calls the load method. function doFilter(target){ var name = getPluginName(target); var state = $.data(target, name); var opts = state.options; if (opts.remoteFilter){ $(target)[name]('load'); } else { $(target)[name]('getPager').pagination('refresh', {pageNumber:1}); $(target)[name]('options').pageNumber = 1; $(target)[name]('loadData', state.filterSource || state.data); } } The request is fast, my server is not a problem. If I comment out this line, time improves by 0,5 seconds: But then it of course does not work like it should.
|
|
|
11
|
General Category / EasyUI for jQuery / Re: datagrid filter - how to reload
|
on: February 24, 2015, 04:56:21 AM
|
I have the same problem. I would like to move the pagination to server side. Datagrid loads fine, but when I change to next page, it's not sending any request.
http://www.jeasyui.com/forum/index.php?topic=3820.0http://www.jeasyui.com/forum/index.php?topic=4303.0These topics help to solve this issue. Another way is not to recreate the pagination component in myLoadFilter method of datagrid-filter.js (remove this code): if (opts.pagination){ var dg = $(this); var pager = dg[name]('getPager'); pager.pagination({ onSelectPage:function(pageNum, pageSize){ opts.pageNumber = pageNum; opts.pageSize = pageSize; pager.pagination('refresh',{ pageNumber:pageNum, pageSize:pageSize }); //dg.datagrid('loadData', state.filterSource); dg[name]('loadData', state.filterSource); }, onBeforeRefresh:function(){ dg[name]('reload'); return false; } }); if (name == 'datagrid'){ var start = (opts.pageNumber-1)*parseInt(opts.pageSize); var end = start + parseInt(opts.pageSize); data.rows = data.rows.slice(start, end); } else { var topRows = []; var childRows = []; $.map(data.rows, function(row){ row._parentId ? childRows.push(row) : topRows.push(row); }); data.total = topRows.length; var start = (opts.pageNumber-1)*parseInt(opts.pageSize); var end = start + parseInt(opts.pageSize); data.rows = $.extend(true,[],topRows.slice(start, end).concat(childRows)); } }
|
|
|
12
|
General Category / EasyUI for jQuery / Re: datagrid filter - how to reload
|
on: February 23, 2015, 09:22:09 AM
|
I have the same problem. I would like to move the pagination to server side. Datagrid loads fine, but when I change to next page, it's not sending any request.
Also the filter rules are sent to server even if remoteFilter = false.
|
|
|
13
|
General Category / EasyUI for jQuery / Re: Datagrid enableFilter performance problem
|
on: February 20, 2015, 01:42:12 AM
|
After examining the datagrid filter code I noticed that this loop in createFilterButton method is taking a long time: $.each(['nofilter'].concat(operators), function(index,item){ var op = opts.operators[item]; if (op){ menu.menu('appendItem', { text: op.text, name: item }); } });
If I replace this with native Javascript for loop, time improves ~ < 0.1 s... but also in in jquery.menu.js there is $.fn.menu.methods={ appendItem:function(jq,_56){ return jq.each(function(){ _3a(this,_56); }); }};
I think you should not use jQuery each because it can be much slower than the native loop. http://code.tutsplus.com/tutorials/10-ways-to-instantly-increase-your-jquery-performance--net-5551jQuery's each function takes over 10 times as long as JS native "for" loop. This will certainly increase when dealing with more complicated stuff, like setting CSS attributes or other DOM manipulation operations. Edit: maybe the problem is more with this line in createFilter method input.addClass('datagrid-filter').attr('name', field); Changing it to this: var input_tmp = input[0]; input_tmp.setAttribute('class',input_tmp.className += ' datagrid-filter'); input.attr('name', field); improved time by 0,5 seconds! http://www.zachleat.com/web/quick-performance-tip-jquery-and-addclass/Another half a second can be gained by removing this line from the for loop there: resizeFilter(target, field);
|
|
|
14
|
General Category / EasyUI for jQuery / Datagrid enableFilter performance problem
|
on: February 16, 2015, 07:28:07 AM
|
If I take this example: http://www.jeasyui.com/tutorial/datagrid/datagrid30_demo.html and copy paste columns so that there are 36 of them in total... Then this measurement shows that initializing the filter component is taking 2,6 seconds in Firefox and 3,1 in Chrome, using latest browser versions... $(function(){ var d = new Date(); var dg = $('#dg').datagrid(); dg.datagrid('enableFilter', [{ field:'listprice', type:'numberbox', options:{precision:1}, op:['equal','notequal','less','greater'] },{ field:'unitcost', type:'numberbox', options:{precision:1}, op:['equal','notequal','less','greater'] },{ field:'status', type:'combobox', options:{ panelHeight:'auto', data:[{value:'',text:'All'},{value:'P',text:'P'},{value:'N',text:'N'}], onChange:function(value){ if (value == ''){ dg.datagrid('removeFilterRule', 'status'); } else { dg.datagrid('addFilterRule', { field: 'status', op: 'equal', value: value }); } dg.datagrid('doFilter'); } } }]); console.log(new Date()-d); }); What is wrong?
|
|
|
|