EasyUI Forum
May 03, 2024, 02:58:34 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: cannot addRow when using formatter in edatagrid mode  (Read 5954 times)
fen9ye
Newbie
*
Posts: 7


View Profile
« on: June 08, 2014, 10:27:28 PM »

here is my code:
<th field="deptID" width="50" align="center"
   editor="{
      type:'validatebox',
      options:{
         required:true,
         formatter:function(value,row,index){
            var deptIDStr = value.toString();
            while(deptIDStr.length<3){
               deptIDStr = '0'+deptIDStr;
            }
            return deptIDStr;
         }
      }
   }">deptID</th>
   deptID is the idField,when I press the add Button,it doesn't work.

when I remove the formatter code,it works well.Please give me some hints
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: June 09, 2014, 12:51:28 AM »

The 'validatebox' editor has no 'formatter' option. Please check your code carefully and correct it.
Logged
fen9ye
Newbie
*
Posts: 7


View Profile
« Reply #2 on: June 09, 2014, 09:15:13 PM »

after checking mycode,I find my formatter function wrong because lacking
if(value==null){
 return ;
}
I'm so sorry for my careless.
I still have a question:How can I get a feedback after adding row in edatagrid mode?Can you give me a demo or some hints?
« Last Edit: June 09, 2014, 09:17:15 PM by fen9ye » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: June 10, 2014, 02:17:00 AM »

When added a new row, the 'onAdd' event fires. For more information please visit the edatagrid documentation http://www.jeasyui.com/extension/edatagrid.php.
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!