日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

c 后台输出easyui html,EasyUI——实现展示后台数据代码

發布時間:2025/3/20 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 c 后台输出easyui html,EasyUI——实现展示后台数据代码 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

下面是View顯示代碼:

@{

ViewBag.Title = "Index";

Layout = "~/Views/Shared/_Layout.cshtml";

}

$(function () {

var editRow = undefined;

$("#tb1").datagrid({

fitColumns: true,

striped: true,

//這里需要接收【總行數total】和【數據組rows】的【JSON格式】的數據{total:23,rows:[{},{}]}

url: "/UserExpression/GetAllUserInfos",

singleSelect: false,

pagination: true,

rownumbers: true,

pageSize: ,

pageList: [, , ],

columns: [

[// u.Id,u.UName,u.Pwd,u.Remark,u.SubTime

{ title: "用戶名", field: "UName", allgn: "center", width: },

{ title: "密碼", field: "Pwd", allgn: "center", width: },

{ title: "備注", field: "Remark", allgn: "center", width: },

{ title: "保存時間", field: "SubTime", allgn: "center", width: },

{

title: "編輯", field: "xx", allgn: "center", width: , formatter: function (value, row, index) {

var btn = '修改|刪除';

return btn;

}

},

]

],

//在數據加載成功的時候觸發。

onLoadSuccess: function (data) {

$('.Update').linkbutton({

text: '修改',

iconCls: 'icon-edit',

plain: true,//是否顯示邊線

onClick: function () {

var zhi = $("#tb1").datagrid("getSelections");

window.location.href = '/HomeText/Edit?id=' + zhi[].productID;

}

})

$('.delete').linkbutton({

text: '刪除',

iconCls: 'icon-edit',

plain: true,//是否顯示邊線

onClick: function () {

var zhi = $("#tb1").datagrid("getSelections");

$.ajax({

type: 'POST',

dataType: 'json',

url: '/HomeText/DeleteConfirmed?id=' + zhi[].productID,

success: function (data) {

$("#tb1").datagrid("reload");

}

})

}

})

},

toolbar: [

{

text: "添加",

iconCls: "icon-add",

handler: function () {

window.open("/HomeText/Create")

}

},

{

text: "刪除",

iconCls: "icon-cancel",

}

],

})

})

下面是Controller后臺代碼:

using IBLL;

using SQLModel;

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.Mvc;

namespace MVC展示數據.Controllers

{

public class UserExpressionController : Controller

{

//利用spring.net在Config里面進行配置,這樣就不用new對象了

public IUserInfo UserInfoBLL2 { get; set; }

#region 加載用戶的數據

public ActionResult Index()

{

return View();

}

public ActionResult GetAllUserInfos()

{

//根據分頁顯示數據

int pageSize = Request["rows"] == null ? : int.Parse(Request["rows"]);

int pageIndex = Request["page"] == null ? : int.Parse(Request["page"]);

//--------------------------------第幾頁,每頁幾條,根據id進行查詢

var data = UserInfoBLL2.LoadByPage(pageIndex, pageSize, n => n.Id)

//-----避免重復查詢

.Select(u => new { u.Id, u.UName, u.Pwd, u.Remark, u.SubTime });

//總的數據條數

int total = UserInfoBLL2.Load().Count();

var result = new { total=total,rows=data};

return Json(result, JsonRequestBehavior.AllowGet);

}

#endregion

}

}

部分視圖展示:

easyUI + servlet 展示datagrid數據列表

1:在jsp頁面添加所用easyUI的js和css 2.前臺代碼示例:

【開源】OSharp框架解說系列(2.2):EasyUI復雜布局及數據操作

OSharp是什么? OSharp是個快速開發框架,但不是一個大而全的包羅萬象的框架,嚴格的說,OSharp中什么都沒有實現.與其他大而全的框架最大的不同點,就是OSharp只做抽象封裝,不做實現.依 ...

隨機推薦

WIN7下java環境的搭建

首先,你應該已經安裝了 java 的 JDK 了,筆者安裝的是:jdk-7u7-windows-x64 接下來主要講怎么配置 java 的環境變量,也是為了以后哪天自己忘記了做個備份 1.進入“計算機 ...

Codeforces Round #337 (Div. 2) C. Harmony Analysis 構造

C. Harmony Analysis 題目連接: http://www.codeforces.com/contest/610/problem/C Description The semester i ...

java學習筆記 (9) —— Struts2 國際化

1.Test.java package com.i18n; import java.util.Locale; public class Test1 { public static void main( ...

Ubuntu14.04配置arm-linux-gcc 4.4.3交叉編譯環境

首先下載交叉編譯:不多說,直接貼地址了?http://arm9download.cncncn.com/mini2440/linux/arm-linux-gcc-4.4.3-20100728.tar.g ...

poj 3311 Hie with the Pie(狀態壓縮dp)

Description The Pizazz Pizzeria prides itself or more (up to ) orders to be processed before he star ...

matlab和C語言的break及continue測試

break和continue語句 有兩個附加語句可以控制while和for循環:break和continue語句.break語句可以中止循環的執行和跳到end后面的第一句執行,而continue只中止 ...

Windows下caffe的python接口配置

主要是因為,發現很多代碼是用python編寫的,在這里使用的python安裝包是anaconda2. 對應下載地址為: https://www.continuum.io/downloads/ 安裝py ...

io使用的設計模式

File f = new File("c:/a.txt"); 1. FileInputStream fis = new FileInputStream(f); 2. Reader ...

pygme 安裝

輸入pip install pygame-1.9.3-cp36-cp36m-win32.whl ModuleNotFoundError: No module named 'requests' pip ...

總結

以上是生活随笔為你收集整理的c 后台输出easyui html,EasyUI——实现展示后台数据代码的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。