当前位置:编程学习 > JAVA >>

grid中当时间为空时,正常读取recorde

store的fields和grid中列两者限制一个即可。

举例,让时间字段为空时也能正常显示recorde

[javascript] 

                        renderer:function (val){ 
                            if(val && val.time) { 
                                if(Ext.type(val.time) == "string") { 
                                    val.time = parseInt(val.time); 
                                } 
                                var d = new Date(val.time); 
                                val = d.format("Y-m-d H:i:s"); 
                            } else { 
                                val = ""; 
                            } 
                            return val; 
                        }, 

补充:web前端 , JavaScript ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,