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

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) >

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

發(fā)布時(shí)間:2025/3/20 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 c 后台输出easyui html,EasyUI——实现展示后台数据代码 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

下面是View顯示代碼:

@{

ViewBag.Title = "Index";

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

}

$(function () {

var editRow = undefined;

$("#tb1").datagrid({

fitColumns: true,

striped: true,

//這里需要接收【總行數(shù)total】和【數(shù)據(jù)組rows】的【JSON格式】的數(shù)據(jù){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: "保存時(shí)間", field: "SubTime", allgn: "center", width: },

{

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

var btn = '修改|刪除';

return btn;

}

},

]

],

//在數(shù)據(jù)加載成功的時(shí)候觸發(fā)。

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后臺(tái)代碼:

using IBLL;

using SQLModel;

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.Mvc;

namespace MVC展示數(shù)據(jù).Controllers

{

public class UserExpressionController : Controller

{

//利用spring.net在Config里面進(jìn)行配置,這樣就不用new對(duì)象了

public IUserInfo UserInfoBLL2 { get; set; }

#region 加載用戶的數(shù)據(jù)

public ActionResult Index()

{

return View();

}

public ActionResult GetAllUserInfos()

{

//根據(jù)分頁(yè)顯示數(shù)據(jù)

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

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

//--------------------------------第幾頁(yè),每頁(yè)幾條,根據(jù)id進(jìn)行查詢

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

//-----避免重復(fù)查詢

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

//總的數(shù)據(jù)條數(shù)

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

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

return Json(result, JsonRequestBehavior.AllowGet);

}

#endregion

}

}

部分視圖展示:

easyUI + servlet 展示datagrid數(shù)據(jù)列表

1:在jsp頁(yè)面添加所用easyUI的js和css 2.前臺(tái)代碼示例:

【開(kāi)源】OSharp框架解說(shuō)系列(2.2):EasyUI復(fù)雜布局及數(shù)據(jù)操作

OSharp是什么? OSharp是個(gè)快速開(kāi)發(fā)框架,但不是一個(gè)大而全的包羅萬(wàn)象的框架,嚴(yán)格的說(shuō),OSharp中什么都沒(méi)有實(shí)現(xiàn).與其他大而全的框架最大的不同點(diǎn),就是OSharp只做抽象封裝,不做實(shí)現(xiàn).依 ...

隨機(jī)推薦

WIN7下java環(huán)境的搭建

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

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

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

java學(xué)習(xí)筆記 (9) —— Struts2 國(guó)際化

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交叉編譯環(huán)境

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

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

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

matlab和C語(yǔ)言的break及continue測(cè)試

break和continue語(yǔ)句 有兩個(gè)附加語(yǔ)句可以控制while和for循環(huán):break和continue語(yǔ)句.break語(yǔ)句可以中止循環(huán)的執(zhí)行和跳到end后面的第一句執(zhí)行,而continue只中止 ...

Windows下caffe的python接口配置

主要是因?yàn)?發(fā)現(xiàn)很多代碼是用python編寫(xiě)的,在這里使用的python安裝包是anaconda2. 對(duì)應(yīng)下載地址為: https://www.continuum.io/downloads/ 安裝py ...

io使用的設(shè)計(jì)模式

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 ...

總結(jié)

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

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。