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

查看:18
本文介绍了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 Server Wrappers 在视图中有一个模型,而 KendoUI Web 不仅没有任何模型,而且没有.cshtml"文件;只有 HTML.HTML 似乎只是指向数据检索/更新的数据源,而 KendoUI Server Wrappers 需要一个模型来传递给控制器​​以进行相同类型的操作.

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?

您似乎还可以使用 jQuery 使用 KendoUI Web 工具集(其名称不会更改)的选择器,而不是 KendoUI Server Wrappers.你只是不知道 jQuery 选择器是什么与 KendoUI 服务器包装器.

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/ 的框架开放jQueryKendo UI Server Wrappers/Kendo UI ASP.NET for MVC 仅适用于 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 网页是免费使用的,而服务器包装器(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.

有关服务器包装器Kendo UI 网页.

这篇关于Kendo UI Web 和 Kendo UI ASP.NET for MVC 的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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