简体   繁体   English

Kendo UI网格和窗口的使用CPU使用率很高

[英]Use of Kendo UI Grid & Window Very high CPU Usage

I have a simple app that is a set of Kendo UI windows containing datagrids. 我有一个简单的应用程序,它是一组包含数据网格的Kendo UI窗口。 As soon as its running, its a huge strain on the system and visual grinds to a halt. 一旦运行,它对系统的巨大压力和视觉冲击就停止了。

Its Chrome that is having the issues regardless of the project running or not, if those pages are loaded and just doing nothing other than sitting there in the browser, the computer is extremely slow 无论项目是否运行,它的Chrome都存在问题,如果加载了这些页面,并且除了在浏览器中执行其他操作外,计算机运行速度非常慢

Wondering if anyone had similar issues, how to troubleshoot / resolve. 想知道是否有人遇到类似问题,如何解决/解决问题。

Some sample grid code 一些示例网格代码

@{
    Layout = null;
}

@(Html.Kendo().Grid<DashboardViewModel.Payment>()
    .Name(Guid.NewGuid().ToString())
    .DataSource(dataSource => dataSource
        .Ajax()
        .Sort(sort => sort.Add("paymentId").Descending())
        .Read(read => read.Action("PaymentsJson", "Dashboard"))
    )
    .Columns(columns =>
    {
        columns.Bound(c => c.paymentId).Title("Id");
        columns.Bound(c => c.business).Title("Business");
        columns.Bound(c => c.createdAt).Title("Created").Width(110).DateFormat();
        columns.Bound(c => c.coupon).Title("Coupon");
        columns.Bound(c => c.quantity).Title("Qty").Width(80).Right();
        columns.Bound(c => c.price).Title("Price").Width(100).Right().CurrencyFormat();
        columns.Bound(c => c.discount).Title("Discount").Width(100).Right().CurrencyFormat();
        columns.Bound(c => c.total).Title("Total").Width(100).Right().CurrencyFormat();
    })
    .Filterable()
    .Pageable()
    .Sortable()
    .Groupable()
)

This was actually nothing to do with Kendo at all. 实际上,这与剑道完全无关。 Thanks to Nicholas who made me question it and isolate. 感谢尼古拉斯使我质疑和隔离。

<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">

This line of code in my template was the issue. 我模板中的这一行代码就是问题所在。 Im not even sure how it got there but I dont use or need it. 我什至不知道它怎么到达那里,但我不使用或不需要它。 Removing that line fixed my issues. 删除该行解决了我的问题。 Perhaps that css was conflicting with something in kendo, not sure. 也许不确定CSS是否与剑道中的某些内容冲突。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM