ACE一些控件使用笔记

来源:互联网 发布:php 采集微信文章内容 编辑:程序博客网 时间:2024/05/16 16:23

jqgrid与spirngmvc 参数传递:


1.默认方式:将参数保存到httpservletrequest里,控制层使用 getParameter获取.


2.映射到实体:

例如:在新建一条记录的方法中添加属性:

ajaxEditOptions: { contentType: "application/json",type: "POST" },

以及

 serializeEditData: function(postdata) {
           return JSON.stringify(postdata);
       },

完整代码如下:

{ //new record formurl: 'addSaleActivities/'+getUser(),width: 700,closeAfterAdd: true,recreateForm: true,    ajaxEditOptions: { contentType: "application/json",type: "POST" },viewPagerButtons: false,beforeShowForm : function(e) { var form = $(e[0]);form.closest('.ui-jqdialog').find('.ui-jqdialog-titlebar').wrapInner('<div class="widget-header" />')style_add_form(form);}, serializeEditData: function(postdata) {            return JSON.stringify(postdata);        },afterComplete: function (response) {layer.msg(response.responseText, {time: 2000});}}


bootstrap-datepicker日期控件使用:

引入依赖:

<script th:src="@{/assets/js/date-time/bootstrap-datepicker.js}"></script><link rel="stylesheet" th:href="@{/assets/css/datepicker.css}" />

定义空间容器:

 <div class="input-group"><input class="form-control date-picker"id="startTime" type="text" /> 
        <span class="input-group-addon"> 
           <i class="fa fa-calendar bigger-110"></i>        </span></div>
初始化datepicker:

$('#startTime').datepicker({  dateFormat: 'yy-mm-dd'    });
效果如下图