$ (_ 1e0) [0]. innerHTML = _ 1e4. join (""); I found a similar place to modify it. The test results are the same. It has no effect. It may be different from the author's version. My version is 1.3, and my version is 1.33.After a long time, I had to continue debugging and tracking myself. After hard work, we finally found the real killer that caused the slowness. The code that causes real slowness is as follows:
For (var I = 0; I <trs2.length; I ++ ){
Var tr1 = $(trs1 [I]);
Var tr2 = $(trs2 [I]);
Tr1.css ("height ","");
Tr2.css ("height ","");
Var _ 43f = Math. max (tr1.height (), tr2.height ());
Tr1.css ("height", _ 43f );
Tr2.css ("height", _ 43f );
}
The Code clearly shows that the height of the two rows in the table is compared above, and the height is assigned to each row.
Solution: the murderer finds the solution. How can this problem be solved? The author directly blocks their comparison and assignment. Let the browser automatically adapt to the height.
As follows:
For (var I = 0; I <trs2.length; I ++ ){
/*
Var tr1 = $(trs1 [I]);
Var tr2 = $(trs2 [I]);
Tr1.css ("height ","");
Tr2.css ("height ","");
Var _ 43f = Math. max (tr1.height (), tr2.height ());
Tr1.css ("height", _ 43f );
Tr2.css ("height", _ 43f );
*/
}
Okay, after shielding. Let's test the efficiency. Test 10 thousand records. The test code snippets are as follows:
Var obj = {'Total': 100, 'rows ': [{id: '1', name: '1'}, {id: '2', name: '2'}]};
For (var I = 0; I <10000; I ++ ){
Var row = ({id: 'id' + I, name: '1 '});
Obj. rows. push (row );
}
$ ('# Tt'). datagrid ({
Url: null,
Pagination: true,
PageSize: 20,
PageNumber: 1,
Rownumbers: true,
FitColumns: false,
Columns :[[
{Field: 'id', title: 'id', width: 100 },
{Field: 'name', title: 'name', width: 100}
]
});
$ ('# Tt'). datagrid ('loaddata', obj );
Now there are 10000 records. IE8 only takes less than 10 seconds to load. Change to 3000 records, as long as 1 ~ Loading completed in 2 seconds.
Conclusion: Direct blocking of the damn height code. Hey, there are surprises. EASYUI version: 1.3