zoukankan      html  css  js  c++  java
  • easyuI企业管理系统-实战二 表格引入json数据

    今天你学习easyui了吗?
    首先,刚学习easyui的朋友们可以多去easyui中文网中进行学习,本篇介绍easyui+php数据如何搭建。
    <
    script> $(function(){ $("#tt").datagrid({ height:$("#body").height()-$('#mainPanle').height(), $("#body").width(), idField:'user_id', //data: data, url:'{:U('Inter/admin/category_list')}', //php提供接口,引入json数据 singleSelect:true, nowrap:true, fitColumns:true, rownumbers:true, showPageList:false, columns:[[ {field:'category_name',title:'分类名',100,halign:"center", align:"left"},//数据表格中对应的字段 {field:'category_vip',title:'分类折扣%',100,halign:"center", align:"left"}, {field:'category_agde',title:'代理商折扣%',100,halign:"center", align:"left"}, {field:'category_deco',title:'供销商折扣%',100,halign:"center", align:"left"}, {field:'category_image',title:'分类示意图',300,height:230,align:'center', formatter:function(value,row,index){return '<img style=" 100px;height: 100px;" src="'+row.category_image+'" />';}//表格独立显示 } ]], toolbar:'#tt_btn', pagination:true, pageSize: 20, pageList: [5,10,15,30], striped:true, //交替显示行背景 onDblClickRow:function(rowIndex, rowData){//双击方法 viewDetail(rowData.user_id); } }); }) function viewDetail(date, id){ var row = $("#tt").datagrid("getSelected"); if (row) { $("#dlg1").dialog("open").dialog('setTitle', '分类相关信息'); $("#fm2").form("load", row); url = "{:U('Inter/admin/category_update')}?id=" + row.category_id; } } //监听窗口大小变化 window.onresize = function(){ setTimeout(domresize,300); }; //改变表格宽高 function domresize(){ $('#tt').datagrid('resize',{ height:$("#body").height()-$('#mainPanle').height(), $("#body").width() }); } </script>

    <body>
    <table id="tt" style="table-layout:fixed;"
    ></table>
      //id名要与上面的datagrid一一对应
    </body>

  • 相关阅读:
    pfofinet和S7
    A1010 Radix [二分/******]
    A1005 Spell It Right
    最大回文子串长度 [dp]
    HDU 1159 Common Subsequence [最长公共子序列]
    1045 Favorite Color Stripe [动态规划/最长不下降子序列]
    1007 Maximum Subsequence Sum [动态规划]
    数塔问题(递归/递推)
    hdu 畅通工程 [Kruskal/Prime]
    1087 All Roads Lead to Rome [dj]
  • 原文地址:https://www.cnblogs.com/maojiayan/p/4892259.html
Copyright © 2011-2022 走看看