基于datagrid框架的查询

2020-05-17 06:24:24易采站长站整理

<!–由于datebox框架上面的数据必须是时间格式的,所以我们用editable=”false”来禁止用户手动输入,以免报错–>
<th>创建结束时间</th>
<td>
<input class=”easyui-datetimebox” editable=”false” name=”nsubEndTimeame” /></td>
<td><a class=”easyui-linkbutton” href=”javascript:void(0);” onclick=”searchFunc();”>查找</a></td>
<td><a class=”easyui-linkbutton” href=”javascript:void(0);” onclick=”clearSearch();”>清空</a></td>
</tr>
</table>
</form>
</div>
<div data-options=”region:’center’,split:false”>
<table id=”dg”>
</table>
</div>
</div>
</div>
</div>


Jquery的扩展代码:



var sy = $.extend({}, sy);/*定义一个全局变量*/


sy.serializeObject = function (form) { /*将form表单内的元素序列化为对象,扩展Jquery的一个方法*/
var o = {};
$.each(form.serializeArray(), function (index) {
if (o[this[‘name’]]) {
o[this[‘name’]] = o[this[‘name’]] + “,” + this[‘value’];
} else {
o[this[‘name’]] = this[‘value’];
}
});
return o;
};


图示: