zoukankan      html  css  js  c++  java
  • kendo ui之grid列表

    1.test_grid.jsp

    <html>
    <head>
      <%@ include file="/WEB-INF/jsp/common/top.jsp"%>
      <meta http-equiv="Content-Type" content="text/html;">
      <link href="<%=path%>/staticresources/css/test/test_grid.css" rel="stylesheet">
      <script type="text/javascript" src="<%=path%>/staticresource/js/test/test_grid.js"></script>
    </head>
    <body>
      <
    div id="grid"></div>
    </body>
    </html>

    2.test_grid.js$(document).ready(function() {rgs=$("#target").val();

        createGrid(args);
    });
    function createGrid(value){
         var dataSource=new kendo.data.DataSource({
         transport:{
               read:{
                    type:"post",
                    url:   path+"^_^";
                    contentType:"application/json;"
                    dataType:"json"
        },    
        parameterMap:function(options,operation){
           if(operation=="read"){
                 if(value!='null'&&value!=undefined&&value!='')
                    options['^*^']=value;
                 }
                 return json.stringify(options);
           }
        }, 
        pagesize:^_^,
        schema:{
            data : function(d) {
              return d.data;
            },
            total : function(d) {
              return d.total;
            },
            model : {
            id : "id",
            fields : {
                     text : {
                     type : "string"
                     }
                    }
            }
    }, serverPaging:
    true, serverFiltering:false, serverSorting:false, change:function(){ (#_#); } }); $("#grid").kendoGrid({ dataSource : dataSource, sortable : true, selectable : "row", change : function() { (#_#); }, pageable : { refresh : true, pageSizes : true }, columns : [{
    hidden : true,
         field : "id",
           title : "id",
    },{
          
    field : "text",
    title : text,
               }],
            toolbar : [ {
                template :        kendo.template($("#toolBarTemplate").html())
            } ],
            cancel : function(e) {
                e.preventDefault();
            }
        });
    }                
  • 相关阅读:
    Hive窗口函数
    自然周与自然月的Hive统计SQL
    Spark中的Join类型
    随机生成验证码类
    mysql看视频笔记
    sql工作记录
    mysql和sqlserver的区别
    mysql的安装配置
    把一个数组遍历倒序放到另一个数组中,数组取值是c:out value
    Echarts雷达代码
  • 原文地址:https://www.cnblogs.com/liuxing0705/p/3461992.html
Copyright © 2011-2022 走看看