EasyUI Forum
April 27, 2024, 03:13:18 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  General Category / EasyUI for jQuery / how to rewrite scrollview render on: June 06, 2021, 03:38:58 AM
like
 $.extend($.fn.datagrid.defaults.view, {
    render: function(target, container, frozen){
       ***;
    }
});
2  General Category / EasyUI for jQuery / $.messager.alert() in keydown event of numberbox don't display 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

3  General Category / EasyUI for jQuery / Re: in datagrid scrollview, selectRecord is not work correct! on: January 11, 2019, 05:48:01 PM
sorry ! I didn't look carefully.
thank you !
Now,I known how to do it.
4  General Category / EasyUI for jQuery / Re: in datagrid scrollview, selectRecord is not work correct! on: January 10, 2019, 07:28:00 PM
 this example http://code.reloado.com/oquleg3/edit#preview
It seems not right either

if i scroll  to line  5671,then  click this line
then click   the selectRow button
it show the line 103 information
5  General Category / EasyUI for jQuery / in datagrid scrollview, selectRecord is not work correct! on: January 08, 2019, 09:21:24 PM
<!DOCTYPE html>
    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>DataGrid Virtual Scrolling - jQuery EasyUI Demo</title>
        <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/default/easyui.css">
        <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/icon.css">
        <script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.min.js"></script>
        <script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
        <script type="text/javascript" src="https://www.jeasyui.com/easyui/datagrid-scrollview.js"></script>
    </head>
    <body>
        <h2>DataGrid Virtual Scroll View Demo</h2>
        <p>Drag the vertical scroll and release it to navigate to the desired page.</p>
       
        <div style="margin-bottom:10px">
            <select onchange="load(this.value)">
                <option value="remote">Load Remote Data</option>
                <option value="local">Load Local Data</option>
            </select>
         
        </div>
          <table id="tt"  style="width:700px;height:300px">
    </table>
     
        <script type="text/javascript">
           $(function(){
         $('#tt').datagrid({
                 title: 'DataGrid - VirtualScrollView',
                   url: 'datagrid27_getdata.php',   
                   view: scrollview,
                 singleSelect: true,
                 rownumbers: true,
                 idField:'inv',
                   autoRowHeight:false,
                  pageSize:50,
                 columns: [[
                     {
                         title: 'Action',
                         field: 'action',
                          width: 100,
                         formatter: function(val, row, index)
                            {
                                 var str= '<a href="#" class="easyui-linkbutton" onclick="test('+row.inv+')">test</a>';
                                 var $div = $("<div/>").append(str);
                                 return $div.html();
                            }
                      },
                     {
                         width: 150,
                         title: 'Inv No',
                         field: 'inv'
                        }  ,
                     {
                         width: 150,
                         title: 'Date',
                         field: 'date'
                        },
                     {
                         width: 150,
                         title: 'Name',
                         field: 'name'
                        },
                     {
                         width: 150,
                         title: 'Amount',
                          field: 'amount'
                         },
                     {
                         width: 150,
                         title: 'Price',
                         field: 'price'
                      },
                      {
                         width: 150,
                         title: 'Cost',
                         field: 'cost'
                       }
                        ,
                       {
                           width: 150,
                         title: 'Note',
                         field: 'note'
                      }                             
                 ]]
            });
        });

           function test(inv) {
                   $('#tt').datagrid('selectRecord',inv);    //is not work correct
                   var row = $('#tt').datagrid('getSelected');
                   alert(row.name);
            }

            function loadLocal(){
                var rows = [];
                for(var i=1; i<=8000; i++){
                    var amount = Math.floor(Math.random()*1000);
                    var price = Math.floor(Math.random()*1000);
                    rows.push({
                        inv: i,
                        date: $.fn.datebox.defaults.formatter(new Date()),
                        name: 'Name '+i,
                        amount: amount,
                        price: price,
                        cost: amount*price,
                        note: 'Note '+i
                    });
                }
                $('#tt').datagrid('loadData', rows);
            }
            function load(mode){
                if (mode == 'local'){
                    loadLocal();
                } else {
                    $('#tt').datagrid({
                        url:'datagrid27_getdata.php'
                    });
                }
            }
        </script>
        <style type="text/css">
            .datagrid-header-rownumber,.datagrid-cell-rownumber{
                width:40px;
            }
        </style>
    </body>
    </html>
6  General Category / Bug Report / Re: maskedbox has bug? on: April 26, 2018, 05:10:52 PM
sorry !
In IE there is no problem.
it can worked under any IME(Input Method Editors).

In Firefox ,
under english IME ,it is no problem.
but under  chinese IME
it can input any key.

<!DOCTYPE html>
<html>
<head>
   <meta charset="UTF-8">
   <title>Basic MaskedBox - 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>
</head>
<body>

         <input class="easyui-maskedbox" mask="(999) 999-9999" label="Phone Number:" labelPosition="top" style="width:100%">      
</body>
</html>
7  General Category / Bug Report / maskedbox has bug? on: April 25, 2018, 07:17:53 PM
in IE ,it can't input any key.
I have tested in IE 8 and IE 11.
in Firefox ,it can input any key  ,the rule is not work.
8  General Category / Bug Report / dialog.dialog('destroy') in win10 IE11 bug! on: March 19, 2018, 06:56:16 PM
sorry !
my english is not so good!
I have a question   .

  var dialog_1 = dialog ({
        title: 'aaa',
        url: contextPath + syRoleForm.html',
        model:true,
        buttons: [{
            text: 'add',
            handler: function () {
          $.post('Handler_syRoleGrant.ashx'
          , function (result) {
                      dialog_1.dialog('destroy');
             },
          'json');              
            }
        }]
    });


syRoleForm.html


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
   <meta http-equiv="Expires" content="0" />
    <meta http-equiv="Progma" content="no-cache" />
    <meta http-equiv="cache-control" content="no-cache,must-revalidate" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title></title>
  
    <script type="text/javascript">
      
    </script>
</head>
<body>
 <div>  test</div>
</body>
</html>
  

when 'Handler_syRoleGrant.ashx' return

dialog_1.dialog('destroy');

Hint error  ,
The object does not support this operation


If it is as follows

  var dialog_1 = dialog ({
        title: 'aaa',
        url: contextPath + syRoleForm.html',
        buttons: [{
            text: 'add,
            handler: function () {      
                      dialog_1.dialog('destroy');                       
            }
        }]
    });

It is no error

in IE8 firefox is no error
9  General Category / EasyUI for jQuery / Re: datagrid field formatter on: March 23, 2017, 06:00:05 PM
This is not very convenient.

Although the following method can be used
$.extend($.fn.datagrid.methods, {
   onLoadSuccess: function(){
   $.parser.parse($(this).datagrid('getPanel'));
}
});


But some datagrid onloadsucess events need to  rewrite

The following code must be added in onLoadSuccess event again
$.parser.parse($(this).datagrid('getPanel'));
10  General Category / EasyUI for jQuery / datagrid field formatter on: March 20, 2017, 01:37:48 AM
sorry ,I Only know a little bit of English,
then I used google translation。
grid = $('#dg').datagrid({
        rownumbers: true,
        singleSelect: true,
        autoRowHeight: true,
        pagination: true,
        idField: 'ID',
        fit: true,
        url: contextPath + '/service/yw/Handler_user.ashx',    
        pageSize: 15,
        pageList: [15, 20, 30],
        fitColumns: true,
        columns: [[
            { field: 'IDENTITYCARD', title: '员工编号', width: 100 },
                { field: 'action', title: '操作', width: 150, align: 'center', formatter: check_action }
        ]]
    });
function pagerFilter(data) {
return '<a href="#" id="first" class="easyui-linkbutton" >modi</a> ';
}

The easyui-linkbutton style No  applied。

It Can be achieved by the following method:
onLoadSuccess(data)
{
$('#first').linkbutton();
}


Now i used the next code :

var datagrid_render = $.fn.datagrid.defaults.view.render;
$.extend($.fn.datagrid.defaults.view, {
    render: function (target, container, frozen) {
        datagrid_render.call(this, target, container, frozen);  
        var ddd = $(target).find("td[field]");
        $.parser.parse(ddd);
    }
});

Whether there are plans to directly support this feature?
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!