javascript - 什么是客户端和服务器端数据表处理?

标签 javascript asp.net-mvc jquery-plugins datatables

我曾尝试在 Google 上进行研究,但失败了,在这里对客户端和服务器端 jQuery 数据表处理的含义有一个基本但很好的理解。我知道客户端通常是 Web 浏览器,它与用户交互,服务器是 http 服务器,但仅此而已。如果有人可以帮忙简要描述一下数据处理的两个方面?如果有例子就太好了。即使没有,也很棒。

<table id="datatable" class="table">
    <thead>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Budget)
        ........
    </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
    ...........

<script type="text/javascript">
    $(document).ready(function () {
        $('#datatable').dataTable();
    });
</script>

那么,脚本代码是我需要为客户端处理做的所有事情吗?

最佳答案

请阅读有关 processing modes 的官方文档.

  • 客户端处理 - 预先加载完整的数据集,并在浏览器中完成数据处理(排序、过滤、分页)。

    参见this example使用客户端处理方式对数据表进行处理。

  • 服务器端处理 - 每次表重绘都会发出 Ajax 请求,仅返回每次显示所需的数据。数据处理(排序、过滤、分页)在服务器上执行。

    参见this example采用服务器端处理方式处理数据表。

关于javascript - 什么是客户端和服务器端数据表处理?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42753656/

相关文章:

javascript - 从表单 javascript 读取数字值

javascript - 无法通过 for 循环传递动态 div id

jquery - Slicknav 与 WordPress

jquery - 使用 jQuery.ui.maps 查找标记 -

javascript - 编译失败: Module not found: Can't resolve '../../common/form' in 'src' components time'

javascript - 如何将 api 调用(使用基于 Promise 的 Axios 库)的结果返回到调用范围?

ASP.NET MVC : How do you get the current URL of the page in the view?

c# - RequiredIf 没有触发客户端验证

javascript - 为mvc3项目中的单个页面编写css

javascript - 如何在 jQuery 自定义插件中访问用于关闭的局部变量?