EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: mygod on February 09, 2020, 09:47:19 PM



Title: $.messager.alert() in keydown event of numberbox don't display
Post by: mygod on February 09, 2020, 09:47:19 PM
<!DOCTYPE html>
<html>
<head>
   <meta charset="UTF-8">
   <title>Basic NumberBox - jQuery EasyUI Demo</title>
   <link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
   <link rel="stylesheet" type="text/css" href="../../themes/icon.css">
   <link rel="stylesheet" type="text/css" href="../demo.css">
   <script type="text/javascript" src="../../jquery.min.js"></script>
   <script type="text/javascript" src="../../jquery.easyui.min.js"></script>
<script type="text/javascript" >
$(function () {
    $("#NN").numberbox({
        "onChange": function (newValue, oldValue)
         {
                 $.messager.alert('alert', 'hello!', 'warning',function(){
                         var temp=1;
                 });
        }
    });
 });
 </script>
</head>
<body>
   <h2>Basic NumberBox</h2>
   <p>The NumberBox can only accept inputing numbers.</p>
   <div style="margin:20px 0;"></div>
   <div class="easyui-panel" style="width:100%;max-width:400px;padding:30px 60px;">
      <div style="margin-bottom:20px">
          <input id="NN" class="easyui-numberbox" data-options="min:0,required:true,precision:2,value:0.00"
                    style="width: 100%;" />
      </div>
      <div style="margin-bottom:20px">
         <input class="easyui-numberbox" label="Amount:" labelPosition="top" value="100" style="width:100%;">
      </div>
      <div style="margin-bottom:20px">
         <input class="easyui-numberbox" label="Discount:" labelPosition="top" value="20" suffix="%" style="width:100%;">
      </div>
   </div>
   
</body>
</html>

when I put some numbers in the NN,
then enter press , var temp=1 is execute ,but $.messager.alert don't display
when  mouse click other places ,var temp=1 is execute  ,$.messager.alert  also display