EasyUI Forum
November 03, 2025, 10:16:03 PM *
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 / Bug Report / Re: formatter in datagrid has bug in 1.4.2 on: March 09, 2015, 02:55:21 AM
That's no matter. The 'formatter' function is called by $.fn.datagrid.defaults.view.renderRow. At the first time, the datagrid will call 'renderRow' with empty row data to render an empty row.
If you really want to prevent the 'formatter' function from calling more than once, please override the 'renderEmptyRow' function of view to solve this issue.
Code:
(function($){
var renderEmptyRow = $.fn.datagrid.defaults.view.renderEmptyRow;
$.extend($.fn.datagrid.defaults.view, {
renderEmptyRow:function(target){
var fields = $(target).datagrid('getColumnFields');
for(var i=0; i<fields.length; i++){
var col = $(target).datagrid('getColumnOption', fields[i]);
col.formatter1 = col.formatter;
col.styler1 = col.styler;
col.formatter = col.styler = undefined;
}
renderEmptyRow.call(this, target);
for(var i=0; i<fields.length; i++){
var col = $(target).datagrid('getColumnOption', fields[i]);
col.formatter = col.formatter1;
col.styler = col.styler1;
col.formatter1 = col.styler1 = undefined;
}
}
})
})(jQuery);

There is no such problem in 1.4.1.
Only the 1.4.2 need to write like this?
2  General Category / Bug Report / formatter in datagrid has bug in 1.4.2 on: March 08, 2015, 10:20:05 PM
my data is only 2 rows,
我的数据只有2行,

but it will call the formatter function 3 times.
但是它会触发3次formatter的方法

In first time,the 'value ,row' is undefined. Undecided
第一次执行的时候,参数的'value,row'都是undefined
3  General Category / Bug Report / some bug on: August 03, 2011, 05:40:44 PM
on 1.2.3 , if you using "for(.. in...)",You will see something you do not wanted to see;
Code:
    <script src="../js/jquery-easyui/jquery-1.4.4.min.js" type="text/javascript"></script>
    <script src="../js/jquery-easyui/jquery.easyui.min.js" type="text/javascript"></script>
    <script language="javascript">

        function aaa() {
            var a = ["a", "b", "c"];
            for (var el in a) {
                alert(a[el]);
            }
        }

       
    </script>
</head>
<body onload="aaa()">
</body>

Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!