EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: zolotoy on August 05, 2015, 10:03:27 AM



Title: Sorting treegrid with a large number of columns
Post by: zolotoy on August 05, 2015, 10:03:27 AM
I have implemented some tricks that have been recommended here to improve the overall treegrid performance.
Code:
var origTreegrid_autoSizeColumn = $.fn.datagrid.methods['autoSizeColumn'];
            $.extend($.fn.treegrid.methods, {
                autoSizeColumn: function (jq, field) {
                    $.each(jq, function () {
                        var opts = $(this).treegrid('options');
                        if (!opts.skipAutoSizeColumns) {
                            var tg_jq = $(this);
                            if (field) origTreegrid_autoSizeColumn(tg_jq, field);
                            else origTreegrid_autoSizeColumn(tg_jq);
                        }
                    });
                }
            });

And
Code:
 skipAutoSizeColumns: true,
                onBeforeExpand: function () {
                    $(this).treegrid('options').skipAutoSizeColumns = true;
                },
                onBeforeCollapse: function () {
                    $(this).treegrid('options').skipAutoSizeColumns = true;
                },
                onExpand: function () {
                    $(this).treegrid('options').skipAutoSizeColumns = true;
                },
                onCollapse: function () {
                    $(this).treegrid('options').skipAutoSizeColumns = true;
                },

While the above code has improved performance alot I am still experiencing bad performance. Specifically with sorting. My grid has ~ 20 columns and about 160 rows. Lowering a numbers of rows does not make any difference, but minimizing a number of columns to three removes any delay. So, my question is what else needs to be done to have datagrid actually performing well?

Grid performance is a major issue for us.

Tnanks