EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: jxyxhz on May 03, 2012, 10:36:31 PM



Title: DataGrid去除单击行选择事件,代码不兼容
Post by: jxyxhz on May 03, 2012, 10:36:31 PM
onLoadSuccess: function () {
            function bindRowsEvent() {
                var panel = $('#TList').datagrid('getPanel');
                var rows = panel.find('tr[datagrid-row-index]');
                var rows = panel.find('div.datagrid-cell-check input[type!=checkbox]');
                rows.unbind('click').bind('click', function (e) {
                    return false;
                });
                rows.find('div.datagrid-cell-check input[type=checkbox]').unbind().bind('click', function (e) {
                    var index = $(this).parent().parent().parent().attr('datagrid-row-index');
                    if ($(this).attr('checked')) {
                        $('#TList').datagrid('selectRow', index);
                    } else {
                        $('#TList').datagrid('unselectRow', index);
                    }
                    e.stopPropagation();
                });
            }
            setTimeout(function () {
                bindRowsEvent();
            }, 10);
        },

这段代码在IE6和IE9下好像是兼容的,但是在IE7、8和Firefox下面不行。请技术人员给予支持。


Title: Re: DataGrid去除单击行选择事件,代码不兼容
Post by: jxyxhz on May 06, 2012, 08:01:32 PM
解决了。