zoukankan      html  css  js  c++  java
  • easy-ui 小白进阶史(一):加载数据,easy-ui显示

    作为一个没上过大学,没经过正规培训的96年的小白来说,找工作就没报特别大的希望,大不了找不到在回炉重造,继续学。。。

    终于在海投了200份的简历之后。。。终于找到了。。。面试也挺简单的,,,第二天就去入职了。。

    行了,,,话不多说。。。我们后台用的easy-ui框架,,,不多说了,,直接上代码。。

    HTML部分:

    @{   

      ViewBag.Title = "小组管理";     Layout = "~/Views/Shared/_Layout.cshtml";

    }

    @section scripts {   

      <script src="@Url.Content("~/Scripts/Community/TopicMng.js")" type="text/javascript"></script>

    }

    <div id="main">  

       <div class="frame-top">    </div>  

       <div class="frame-list">    

         <table id="topiclist"></table>  

       </div>

    </div>

    javascripts:

    $(document).ready(function () {
        TopicMgr.InitPageData();
    });

    var TopicMgr = {

      InitPageData: function () {
            $("#topiclist").datagrid({
                url: "/Community/Topic/List",
                title: "小组管理",
                980,
                height: 760,
                loadMsg: "加载中....",
                fitColumns: false,
                rownumbers: true,
                singleSelect: true,
                idField: "Id",
                columns: [[
                    { field: "Id", title: "ID", 50, align: "left" },
                    { field: "CategoryName", title: "小组类别", 80, align: "left" },
                    { field: "TestTypeName", title: "考试类型", 80, align: "left" },
                    { field: "TopicCont", title: "小组名称", 90, align: "left" },
                    { field: "TopicDesc", title: "简介", 150, align: "left" },
                    { field: "PeriodIndex", title: "当前期数", 70, align: "left" },
                    { field: "TopicIndex", title: "小组排序", 70, align: "left" },
                    { field: "CreatorName", title: "创始人", 100, align: "left" },
                    {
                        field: "PurviewLevel", title: "权限", 80, align: "left",
                            formatter: function (value) {
                                return value == 0 ? "特权小组" : "普通小组"
                            }
                    },
                    {
                        field: "TimeMark", title: "创建时间", 110, align: "left",
                        formatter: function (value) {
                            return FormatJSONDateToDate(value);
                        }
                    }
                ]]
            });
        },

    }

    C#:

     public async Task<JsonResult> List()
            {
                return new JsonResult()
                {
                    Data = await CommunityTopicFacade.ListAsync().ConfigureAwait(false)
                };

  • 相关阅读:
    python 爬虫 urllib模块 url编码处理
    python 爬虫 urllib模块 目录
    python 爬虫 urllib模块介绍
    python 爬虫 目录
    爬虫 介绍
    POJ 2533
    POJ 2531
    POJ 2524
    POJ 2505
    POJ 2521
  • 原文地址:https://www.cnblogs.com/yuhangwang/p/5004699.html
Copyright © 2011-2022 走看看