EasyUI Forum
May 03, 2024, 01:31:48 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: GetChanges() in Datagrid returns unchanged rows when there are numbers.  (Read 5775 times)
samuelzhu001
Newbie
*
Posts: 11


View Profile
« on: September 28, 2016, 02:23:41 PM »

When I use cell editing datagrid, GetChanges() returns the rows that I just click in but make no changes. I find that it only occurs when data contains numbers. For instance, the original data is {qty:10},  it becomes {qty:'10'} after editing.
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: September 28, 2016, 07:10:09 PM »

To solve your issue, you can convert your 'qty' field value to a string value, or override the 'getValue' method of numberbox.
Code:
<script type="text/javascript">
(function($){
    $.extend($.fn.numberbox.methods, {
        getValue: function(jq){
            value = jq.textbox('getValue');
            return parseFloat(value)||'';
        }
    });
})(jQuery);
</script>
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!