EasyUI Forum
April 19, 2024, 09:04:58 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: Validating a cell to compare it another cell  (Read 4015 times)
mapner
Jr. Member
**
Posts: 63


View Profile
« on: February 10, 2018, 09:36:26 AM »

Hi,

I need to edit a cell on a datagrid and validate it for value be lower that previous field/column.

thanks
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: February 12, 2018, 01:36:33 AM »

When begin to edit a row, retrieve the editors and set the 'validType' on each field. Please refer to the code below:
Code:
$('#tt').edatagrid({
  onBeginEdit: function(index,row){
    var ed1 = $(this).datagrid('getEditor',{index:index,field:'listprice'});
    var ed2 = $(this).datagrid('getEditor',{index:index,field:'unitcost'});
    $(ed2.target).numberbox({
      validType: {
        greaterThan: [ed1.target]
      }
    })
  }
});
Logged
battlezad
Newbie
*
Posts: 44


View Profile
« Reply #2 on: February 12, 2018, 05:52:16 AM »

....
never mind, it was trivial Smiley
...
« Last Edit: February 13, 2018, 12:05:01 AM by battlezad » 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!