jquery easyui 动态绑定数据列

function doSearch2() {
var strsql = $(‘#sssql‘).val();
$.ajax({
url: "../HttpHandler/DownloadHandler.ashx?action=StatDownLoadHHH&searchStrSql=" + encodeURI(strsql),
type: "POST",
error: function () {
$.messager.alert(‘错误‘, ‘操作失败!‘, ‘error‘);
},
success: function (result) {
var result = eval(‘(‘ + result + ‘)‘);
//$(‘#tt‘).html(result.hmnr);

$(‘#tt‘).datagrid(result.columns);
}
});

// $(‘#tt‘).datagrid({
// columns: [[
// { field: ‘itemid‘, title: ‘Item ID‘, width: 80 },
// { field: ‘productid‘, title: ‘Product ID‘, width: 80 }
// ]],
// data: [
// { itemid: ‘张三‘, productid: ‘1‘ },
// { itemid: ‘李四‘, productid: ‘2‘ }
// ]
// });

// $(‘#tt‘).datagrid({
// data: [
// { itemid: ‘张三‘, productid: ‘1‘ },
// { itemid: ‘李四‘, productid: ‘2‘ }
// ]
// });

// $(‘#tt‘).datagrid(‘insertRow‘, {
// index: 1,
// row:{
// itemid:‘fsfsdfs‘,
// productid:‘KKKKKKPPoo‘
// }

// });

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>软件管理</title>
<link rel="stylesheet" type="text/css" href="../easyui/themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="../easyui/themes/icon.css" />
<script type="text/javascript" src="../easyui/jquery.min.js"></script>
<script type="text/javascript" src="../easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../easyui/locale/easyui-lang-zh_CN.js"></script>
<script src="DownloadRecordsStat.js" type="text/javascript"></script>

</head>
<body>

<div id="toolbar" style="height:100px">
<input id="sssql" class="easyui-textbox" data-options="multiline:true" value="select * from DOWNLOAD"
style="width:90%;height:100px" ></input>
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="doSearch2()">查询</a>
</div>

<!-- <table id="dg"title="定性指标基础信息" class="easyui-datagrid"style="width:900px; height: 400px; padding-left: 200px;
pagination="true" rownumbers="true"fitcolumns="true"singleselect="true">
<thead>
<tr>
<th field ="firstname"width="50">定性指标级别</th>
<th field ="lastname"width="50">分数</th>
</tr>
</thead>
<tbody>
<tr>
<td>优秀</td>
<td>100</td>
</tr>
<tr>
<td>良好</td>
<td>80</td>
</tr>
<tr>
<td>一般</td>
<td>60</td>
</tr>
<tr>
<td>较差</td>
<td>50</td>
</tr>
</tbody>
</table> -->

<div id = "servicediv" style="width:100%;height:350px; overflow-y: auto">
<!--<table id="dgtbl" style="width:100%;height:450px" >
</table>-->

<table id="tt" title="Frozen Columns" class="easyui-datagrid" style="width:550px;height:250px"

singleSelect="true" iconCls="icon-save">
</table>

</div>

</body>
</html>

时间: 2025-01-05 23:32:56

jquery easyui 动态绑定数据列的相关文章

ASP.NET网站权限设计实现(三)——套用JQuery EasyUI列表显示数据、分页、查询

一.说明: JQuery EasyUI下载地址:http://jquery-easyui.wikidot.com/download,最新版本1.2.2. 首先预览一下界面: 本例实现的功能: 1.多标签 2.分页列表显示数据 3.获取选中行的标识值,删除选中行 实现以上功能主要使用了: 1.layout:布局 2.tabs:多标签 3.datagrid:表格显示数据,并可以分页 4.messager:消息框 5.window:窗口 要了解用法,下载之后,参阅demo文件夹下的demo和官方文档.

jQuery Easyui datagrid 数据表格的使用

jQuery Easyui datagrid 数据表格的使用1. 在页面显示表格的位置 提供<table>标签,指定 id 元素2. 在 JS 代码 $("#grid").datagrid({-}); 完成对表格设置表格列定义远程数据加载分页 顶部工具栏 代码效果 原文地址:https://blog.51cto.com/13587708/2420696

套用JQuery EasyUI列表显示数据、分页、查询

声明,本博客从csdn搬到cnblogs博客园了,以前的csdn不再更新,朋友们可以到这儿来找我的文章,更多的文章会发表,谢谢关注! 有时候闲的无聊,看到extjs那么肥大,真想把自己的项目改了,最近看到一款轻型的UI感觉不错,但是在网上找了好多教程,但是没有一个是完全是C#asp.net写的 无耐下,自己写了下,感觉效果不错,故拿出来和大学分享一下,希望可以抛砖引玉作用. 由于好多人都只是拷贝代码,故在此全用图片作说明. 图片效果图1 这个界面是上左右下结构 左边是一棵树 右边是一个表格 上部

jQuery Easyui datagrid动态列绑定

前几天有人在使用jQuery EasyUI的datagrid时,遇到不会动态绑定列的情况,而网上给出的例子可能也是比较早的处理办法,竟然需要修改easyui源码,其实解决这问题的思路是很简单,我们只需修改要显示的列即可.那位朋友最后改为这种处理时,发现还是有问题,最终我发现她返回不是合法json,里边多个方括号,这里推荐大家使用本站的JSON在线校验格式化工具来验证返回json是否正确. 这里我们以上篇文章中类似的简单json来说明这个问题,比如后台要根据当前用户的权限返回不同的json: 分享

ASP.NET网站权限设计实现——套用JQuery EasyUI列表显示数据、分页、查询

有时候闲的无聊,看到extjs那么肥大,真想把自己的项目改了,最近看到一款轻型的UI感觉不错,但是在网上找了好多教程,但是没有一个是完全是C#asp.net写的 无耐下,自己写了下,感觉效果不错,故拿出来和大学分享一下,希望可以抛砖引玉作用. 由于好多人都只是拷贝代码,故在此全用图片作说明. 图片效果图1 这个界面是上左右下结构 左边是一棵树 右边是一个表格 上部是标题 最下部只是一个空的保留一部分空间 下面开始说下整体结构HTML代码如下 至于HTML代码不想在做多余的解说 下面开始左边的树,

jquery easyui DataGrid 数据表格 属性

中文帮助请点这里:中文属性详解 以下为未完结版 <!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head>

jquery easyUi 根据数据动态创建tabs标签

<link rel="stylesheet" type="text/css" href="tabs.css"> <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.easyui.mi

jQuery EasyUI 没有数据时添加滚动条

onLoadSuccess : function(data) { //表头居中 $(".datagrid-htable td div").css({ "text-align" : "center" }); $('.datagrid-header-row td').unbind('contextmenu')//取消表头右键功能 $(this).datagrid('clearSelections');//取消所有的已选择项 $(this).datag

JQuery EasyUI之DataGrid列名和数据列分别设置不同对齐方式(转)

需求如下 现有数据列三列 Name,Age,CreateDate 数据 张三,18,2000-12-09 :12:34:56 李四,28,2000-12-09 :12:34:56 王麻子,38,2000-12-09 :12:34:56 Jquery Easyui DataGrid中列设置 { field: 'Name', title: '名称', width: 120 ,align:left},{field: 'Age', title: '年龄', width: 120 ,align:right