Kendo UI Web和Kendo UI ASP.NET for MVC之间的区别 [英] Difference between Kendo UI Web and Kendo UI ASP.NET for MVC

查看:171
本文介绍了Kendo UI Web和Kendo UI ASP.NET for MVC之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过Visual Studio创建MVC项目时,将使用".cshtml"文件创建视图.

When creating an MVC project via Visual Studio, Views are created with ".cshtml" files.

KendoUI服务器包装器在视图中有一个模型,而KendoUI Web不仅没有任何模型,而且没有".cshtml"文件.仅HTML. HTML似乎只是指向用于数据检索/更新的数据源,而KendoUI服务器包装程序需要一个模型来传递给控制器​​以进行相同类型的操作.

The KendoUI Server Wrappers have a model in the View whereas the KendoUI Web not only doesn't have any model, but there is no ".cshtml" files; only HTML. The HTML seems to just point to a datasource for data retrieival/updates whereas the KendoUI Server Wrappers need a model to pass to a controller for the same type of operations.

两者之间有什么区别?我只是不了解KendoUI Web概念以及它是如何工作的.自适应渲染呢,在其中创建".cshtml"文件的多个副本以在特定设备上进行渲染. KendoUI Web如何实现?

What is the difference between the two? I just don't understand the KendoUI Web concept and how that works. What about adaptive rendering where you create multiple copies of your ".cshtml" files for rendering on a specific device. How is that achieved with the KendoUI Web?

似乎还可以使用KendoUI Web工具集(名称不变)的选择器来使用jQuery,而不是使用KendoUI Server Wrappers.您只是不知道KendoUI Server Wrappers中的jQuery选择器是什么.

It also appears that you can use jQuery using the selectors for the KendoUI Web toolset (whose name wouldn't change) as opposed to the KendoUI Server Wrappers. You just don't know what the jQuery selectors are with the KendoUI Server Wrappers.

我发现很难对KendoUI Server Wrappers进行编程(尽管应该更容易,更快地实现它们),因为特定扩展需要处理不同的事件,并且不知道选择器的名称是什么是. KendoUI Web工具集似乎并非如此.

I find it very difficult to program against the KendoUI Server Wrappers (even though they are supposed to be easier and faster to implement) because of the different events you would need for a particular extension to handle and not knowing what the selector names are. This does not appear to be the case for the KendoUI Web toolset.

推荐答案

简单地说, Kendo UI Web 已针对任何支持javascript/jQuery Kendo的框架开放适用于MVC的UI Server包装器/Kendo UI ASP.NET 仅适用于ASP.NET MVC项目.

Simply put, Kendo UI Web is open for any framework that can support javascript/jQuery but Kendo UI Server Wrappers/Kendo UI ASP.NET for MVC is for ASP.NET MVC projects only.

使用Kendo UI Web将需要大量额外的编码和处理,而 MVC版本对开发人员更友好,并且易于维护.如果您正在处理ASP.NET MVC项目,则可以使用服务器包装器简化编码.

Working with Kendo UI Web will need lot of extra coding and handling, while the MVC version is more developer-friendly and easier to maintain. If you are working on ASP.NET MVC projects then you can make your coding easy with the server wrappers.

Kendo UI Web是免费使用的,而服务器包装程序(ASP.NET MVC的Kendo UI)则需要每个开发人员付费许可.

Kendo UI web is free to use, whereas the Server wrapper (Kendo UI for ASP.NET MVC) needs paid license per developer.

关于剑道网格的代码差异的简单示例如下:

A simple example of the code differences for a kendo grid is as below:

使用服务器包装

@model IEnumerable<Kendo.Mvc.Examples.Models.ProductViewModel>

@(Html.Kendo().Grid(Model)    
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.ProductID).Groupable(false);
        columns.Bound(p => p.ProductName);
        columns.Bound(p => p.UnitPrice);
        columns.Bound(p => p.UnitsInStock);
    })
    .Groupable()
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()
    .DataSource(dataSource => dataSource
        .Ajax()
        .Read(read => read.Action("Products_Read", "Grid"))
    )
)

使用Kendo UI Web

<script>
    $(document).ready(function() {
        $("#grid").kendoGrid({
            dataSource: {
                data: createRandomData(50),
                pageSize: 10
            },
            groupable: true,
            sortable: true,
            pageable: {
                refresh: true,
                pageSizes: true
            },
            columns: [ {
                field: "FirstName",
                width: 90,
                title: "First Name"
            } , {
                field: "LastName",
                width: 90,
                title: "Last Name"
            } , {
                width: 100,
                field: "City"
            } , {
                field: "Title"
            } , {
                field: "BirthDate",
                title: "Birth Date",
                template: '#= kendo.toString(BirthDate,"dd MMMM yyyy") #'
            } , {
                width: 50,
                field: "Age"
            } ]
        });
    });
</script>

您可以在此处中查看渲染的网格.

You can check the rendered grid here.

有关服务器包装器 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆