easyui datagrid 的小疑点
easyui datagrid 的小问题
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script src="JS/easyUI/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="JS/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
<script src="JS/easyUI/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<link href="JS/easyUI/themes/gray/easyui.css" rel="stylesheet" type="text/css" />
<link href="JS/easyUI/themes/icon.css" rel="stylesheet" type="text/css" />
<script src="JS/wikmenu.js" type="text/javascript"></script>
<script src="JS/wikmain.js" type="text/javascript"></script>
<style type="text/css">
#TextArea1
{
height: 121px;
width: 482px;
}
</style>
<script type="text/javascript">
$(function ()
{
$("#btn_jx").click(function () {
$.post("Default.aspx", { value: $("#TextArea1").val() }, function (res) {
InitGrid(res);
})
});
});
//初始化表格
function InitGrid(res) {
var jsons = $.parseJSON(res);
alert(res);
$('#tab_list').datagrid({
title: '数据列表',//表格标题
// url:res,//请求数据的页面
data: res,
width: '800',//宽度
height: '300',//高度
nowrap: false,//是否换行,True 就会把数据显示在一行里
striped: true,//True 奇偶行使用不同背景色
collapsible: false,//可折叠
sortOrder: 'desc',//排序类型
columns: [[
{ title: '政策列表', field: 'zhc', width: 60 },
{ title: '自动出票', field: 'zdcp', width: 80 },
{ title: '运价', field: 'price', width: 80 },
{ title: '代理费', field: 'dl', width: 80 },
{ title: '奖励', field: 'jl', width: 80 },
{ title: '单张利润', field: 'dz', width: 80 },
{ title: '开票费', field: 'kpf', width: 80 },
{ title: '单张结算价', field: 'dzjs', width: 80 },