EasyUI Forum
May 08, 2024, 12:08:10 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: Blank Datagrid when using formatter  (Read 4021 times)
lorwynz_11
Newbie
*
Posts: 19


View Profile
« on: March 03, 2014, 06:20:59 PM »

Hi! I followed the code base in this tutorial:
http://www.jeasyui.com/tutorial/datagrid/datagrid7.php

But when i applied it in my datagrid, it shows empty data.. All data are not loaded.. Why?


Here's my code:


HTML
Code:
					
<th field="osidate" sortable="true" auto="true" editor="text">OS Installed Date</th>
<th field="bdate" sortable="true" auto="true" editor="text" >BIOS Date</th>
<th field="pdate" sortable="true" auto="true" editor="text"  formatter="formatdate"  >Purchase Date</th>
<th field="process" sortable="true" auto="true" editor="text">Processor</th>
<th field="mobo" sortable="true" auto="true" editor="text">Motherboard</th>
<th field="memory" sortable="true" auto="true" editor="text">Memory Card</th>
<th field="drive" sortable="true" auto="true" editor="text">Hard Drive</th>
<th field="ups" sortable="true" auto="true" editor="text">UPS</th>


JScipt
Code:
     function formatdate(val,row){
var newval = val.slice(-4);
var d = new Date();
var n = d.getFullYear();

var finalval = n - newval;

if (finalval >= 5 ){
return '<span style="color:red;">'+val+'</span>';
} else {
return val;
}
}

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!