首页
互助圈
新手教程
进阶之路
算法原理
架构设计
JAVA进阶
C/C++进阶
Python进阶
JavaScript
数据库
大数据
消息服务
源码解读
JAVA源码
Spring源码
数据库
消息服务
Dubbo源码
面试指南
大厂专栏
面试技巧
面试经验
面试题库
开发资料
文档资料
工具软件
电子书籍
小牛导航
在线工具
登录
当前位置:
首页
>
工具软件
>
Themes Selection
>
使用案例
>
DataGrid Selection
邹麻雀
2023-12-01
<!DOCTYPE html>
<html>
<head>
<meta
charset
=
"UTF-8"
>
<title>
DataGrid Selection - jQuery EasyUI Demo
</title>
<link
rel
=
"stylesheet"
type
=
"text/css"
href
=
"../../themes/default/easyui.css"
>
<link
rel
=
"stylesheet"
type
=
"text/css"
href
=
"../../themes/icon.css"
>
<link
rel
=
"stylesheet"
type
=
"text/css"
href
=
"../demo.css"
>
<script
type
=
"text/javascript"
src
=
"../../jquery.min.js"
></script>
<script
type
=
"text/javascript"
src
=
"../../jquery.easyui.min.js"
></script>
</head>
<body>
<h2>
DataGrid Selection
</h2>
<div
class
=
"demo-info"
>
<div
class
=
"demo-tip icon-tip"
></div>
<div>
Choose a selection mode and select one or more rows.
</div>
</div>
<div
style
=
"
margin
:
10px
0
;
"
>
<a
href
=
"#"
class
=
"easyui-linkbutton"
onclick
=
"
getSelected
()
"
>
GetSelected
</a>
<a
href
=
"#"
class
=
"easyui-linkbutton"
onclick
=
"
getSelections
()
"
>
GetSelections
</a>
</div>
<table
id
=
"dg"
class
=
"easyui-datagrid"
title
=
"DataGrid Selection"
style
=
"
width
:
700px
;
height
:
250px
"
data-options
=
"singleSelect:true,url:'datagrid_data1.json',method:'get'"
>
<thead>
<tr>
<th
data-options
=
"field:'itemid',width:80"
>
Item ID
</th>
<th
data-options
=
"field:'productid',width:100"
>
Product
</th>
<th
data-options
=
"field:'listprice',width:80,align:'right'"
>
List Price
</th>
<th
data-options
=
"field:'unitcost',width:80,align:'right'"
>
Unit Cost
</th>
<th
data-options
=
"field:'attr1',width:250"
>
Attribute
</th>
<th
data-options
=
"field:'status',width:60,align:'center'"
>
Status
</th>
</tr>
</thead>
</table>
<div
style
=
"
margin
:
10px
0
;
"
>
<span>
Selection Mode:
</span>
<select
onchange
=
"
$
(
'#dg'
).
datagrid
({
singleSelect
:(
this
.
value
==
0
)})
"
>
<option
value
=
"0"
>
Single Row
</option>
<option
value
=
"1"
>
Multiple Rows
</option>
</select>
</div>
<script
type
=
"text/javascript"
>
function
getSelected
(){
var
row
=
$
(
'#dg'
).
datagrid
(
'getSelected'
);
if
(
row
){
$
.
messager
.
alert
(
'Info'
,
row
.
itemid
+
":"
+
row
.
productid
+
":"
+
row
.
attr1
);
}
}
function
getSelections
(){
var
ss
=
[];
var
rows
=
$
(
'#dg'
).
datagrid
(
'getSelections'
);
for
(
var
i
=
0
;
i
<
rows
.
length
;
i
++){
var
row
=
rows
[
i
];
ss
.
push
(
'<span>'
+
row
.
itemid
+
":"
+
row
.
productid
+
":"
+
row
.
attr1
+
'</span>'
);
}
$
.
messager
.
alert
(
'Info'
,
ss
.
join
(
'<br/>'
));
}
</script>
</body>
</html>
类似资料:
相关阅读
相关文章
相关问答
快捷导航:
新手教程
算法原理
架构设计
Java进阶
数据库进阶
大厂专栏
面试经验
编程笔记
编程问答
所有专题
文档资料
工具软件
电子书籍
小牛导航
在线工具:
房贷计算器
个税计算器
Linux命令查询
Json格式化
正则表达式
颜色转换
AES加解密
SHA1加密
MD5加密
毒鸡汤
字数统计
随机密码生成
进制转换
Base64编解码
励志句子
Copyright © 2019-2024 小牛知识库@xnip.cn. All Rights Reserved.