easyui控件事件监听委托给jquery事件监听,keyup取最新值问题

十步杀一人_千里不留行 2020-11-13 11:35:37
事件 EasyUI 控件 监听 件事


<div id="<?php echo NS; ?>toolbar">
<div style="padding:5px">
<form id="<?php echo NS; ?>searchform">
<span>订单号:</span>
<input class="easyui-textbox" id="sn" name="sn" data-options="iconCls:'icon-ok',prompt:'订单号'" style="width:200px">
<label>
<a href="#" class="easyui-linkbutton" data-options="text: '搜索', iconCls:'icon-search'" onclick="<?php echo NS; ?>search()"/>
</label>
</form>
</div>
</div>
<p></p><p></p>
<!--AJAX数据填html模板-->
<div id="<?php echo NS;?>dataview_template" style="display:none">
<div style="margin-bottom:5px;font-size:14px;border-bottom:1px solid #ccc">
订单详情
</div>
<table cellspacing="12" style="border-color:#3399ff;padding:0;margin:0;width:100%;height:30px;">
<tbody>
<tr>
<td>订单ID:</td>
<td>{
{id}} </td>
<td>序号:</td>
<td>{
{sn}} </td>
<td>标题描述:</td>
<td>{
{title}} </td>
</tr>
<tr>
<td>订单类型:</td>
<td>{
{_type}} </td>
<td>订单城市:</td>
<td>{
{_cityid}} </td>
<td>总价:</td>
<td>{
{sumprice}} </td>
</tr>
<tr>
<td>成本价:</td>
<td>{
{cosprice}} </td>
<td>支付价:</td>
<td>{
{payprice}} </td>
<td>状态:</td>
<td>{
{_status}} </td>
</tr>
<tr>
<td>支付时间:</td>
<td>{
{paytime}} </td>
<td>会员名称:</td>
<td>{
{_memberid}} </td>
<td>机构名称:</td>
<td>{
{_corperid}} </td>
</tr>
<tr>
<td>订单来源:</td>
<td>{
{_platid}} </td>
<td>添加时间</td>
<td>{
{_addtime}} </td>
<td>联系人手机号</td>
<td>{
{contactmobile}} </td>
</tr>
</tbody>
</table>
</div>
<!--AJAX数据填充容器-->
<div id="<?php echo NS;?>dataview" style='margin:0;padding:20px 50px' data-options='novalidate:true'></div>
<script type="text/javascript">
$(document).ready(function(){
$('#sn').textbox({
inputEvents: $.extend({},$.fn.textbox.defaults.inputEvents,{
keyup:function(event){
alert($(this).val());
},
click:function(event){
alert($(this).val());
}
})
});
});
//JS占位符替换
String.prototype.format = function() {
if(arguments.length === 0) return this;
var obj = arguments[0];
var s = this;
for(var key in obj) {
s = s.replace(new RegExp("\\{\\{" + key + "\\}\\}", "g"), obj[key]);
}
return s;
};
//点击搜索操作按钮
function <?php echo NS; ?>search() {
//格式化键值对name:value
var param = {};
$.each($("#<?php echo NS; ?>searchform").serializeArray(), function () {
param[this['name']] = this['value'];
});
$.ajax({
type: 'POST',
url: '/orders/order/ajax_index/'+param.sn,
dataType: "json",
beforeSend: function (xhr) {$.messager.progress();},
success: function (res) {
$.messager.progress('close');
if (res.status == 200) {
//$.messager.alert('操作提示', res.msg, 'info');
//console.log(res.data.id);
//数据填充
$("#<?php echo NS; ?>dataview").html($("#<?php echo NS; ?>dataview_template").html().format(res.item));
return true;
}
$("#<?php echo NS; ?>dataview").html('');
$.messager.alert('操作提示', res.msg, 'error');
}
});
}
</script>

版权声明
本文为[十步杀一人_千里不留行]所创,转载请带上原文链接,感谢
https://blog.csdn.net/m0_37609579/article/details/106918968

  1. css单位
  2. CSS unit
  3. 前端验证集合
  4. Front end validation collection
  5. Front end learning (4) -- response line, response head, response body
  6. Lesson 27: using time measuring tools to explore available spare time
  7. CSS 单位
  8. EasyUI control event monitoring is delegated to jQuery event monitoring, and Keyup gets the latest value
  9. CSS unit
  10. 前端工具集合
  11. Front end Tools Collection
  12. Introduction to HTTP message format
  13. Introduction to new features of HTML5
  14. Common instructions for Vue
  15. Introduction of bootstrap Blazer component library
  16. HTML5 速览
  17. HTML5 quick view
  18. HTML表格自动排序
  19. For less than $1700, create a private cloud with openstack
  20. Basic learning of JavaScript (1)
  21. 前端编程之路一一HTML标签分类
  22. Front end Programming: HTML tag classification
  23. ColSpan and rowspan merging cells of HTML form elements
  24. JavaScript 日期时间格式化
  25. JavaScript date time formatting
  26. Classification of front end interview questions - html2
  27. CSS block elements
  28. HTML5 form detailed tutorial
  29. HTML5 form detailed tutorial
  30. HTML5新增的元素表
  31. New element table in HTML5
  32. 3D轮播插件vue-carousel-3d非官方最全文档
  33. 3D carousel plug-in vue-carousel-3d
  34. Uniapp (Vue general) integrates Tencent location service SDK -- multi platform small program general
  35. Slowhttptest slow attack tool use details
  36. HTML summary (2)
  37. Overview of CSS3
  38. Front end abnormal monitoring system
  39. 免费网站部署和免费数据库Serverless云存储资源汇总整理
  40. Free website deployment and collection of free database serverless cloud storage resources
  41. Vux form -- a form solution of base vux
  42. 可以直接用于HTML中的特殊字符表 unicode字符集
  43. Can be directly used in HTML special character table Unicode character set
  44. Detailed explanation of HTTP protocol
  45. HTTP request header and request response header
  46. CSS background深度解析
  47. Python web/HTML GUI
  48. Front end standard 2: HTML you know and don't know
  49. Some HTML tags
  50. HTML标签之table
  51. Table of HTML tag
  52. DataTables of jQuery plug-in
  53. Unity calls Google's free translation API (HTTPS interface). Young people don't speak martial arts. How can they speak in multiple languages
  54. Linux entry most commonly used commands, do not learn a bunch of useless commands
  55. Piziheng embedded: a list of common short-range wireless communication protocols (Wi Fi / Bluetooth / ZigBee / thread...)
  56. Naming rules for the front end team of ladder
  57. HTML logo related symbols
  58. Node . JS: development resources and technology stack arrangement
  59. Unity calls Google's free translation API (HTTPS interface). Young people don't speak martial arts. How can they speak in multiple languages
  60. Straighten out JavaScript (18) - statements and operators