zoukankan      html  css  js  c++  java
  • Extjs 回调取得store中的数据

     <script type="text/javascript">
    		  Ext.onReady(function(){
    		  var noticeInfoStore =new Ext.data.Store({		//公告信息store
    		        proxy: new Ext.data.HttpProxy({url:"/INAS4/maintenance/notice/getNoticeInfoByTypeId.action", method:'POST'}),
    		        reader: new Ext.data.JsonReader({totalProperty: 'totalProperty', root:'root'},[{name: 'id'},{name: 'name'},{name: 'title'},{name: 'content'},{name: 'userName'},{name: 'author'},{name: 'issueTime'}])
    		    });
    		   noticeInfoStore.reload({
    		    params: {start: 0, limit: 10, recordCount: -1, typeId: null},
    		    callback:function(r,options,success){
    		            if(success){
    		                    noticeInfoStore.each(function(record) { 
    		                    var myDate = new Date(); 
    		    				var a1 = record.get('issueTime').time; //通知时间
    		    				var a2 = myDate.getTime();//系统时间
    		    				subtractionTime = a2-a1; //系统时间减去通知发布的时间
    		    				var limitTime=3*24*60*60*1000;//3天时间,毫秒   
    		     					if(subtractionTime<limitTime){
    		    						Ext.MessageBox.confirm('提示','存在最近3天内的公告,您是否前去浏览?',function(btn){  
    		                				if(btn!='yes'){
    									}else{
    									//window.location.href = "/INAS4/maintenance/notice/displayNotice.jsp";
    									document.frames['MyWorkFrame'].location = "/INAS4/maintenance/notice/displayNotice.jsp";
    										}		
    		            				});
    		    					}  
    		  					});  
    		             };
    		           }
    		        })
    			})
      </script>
    

      

  • 相关阅读:
    数据结构笔记
    并查集
    计算两个数的最大公约数和最小公倍数
    行盒
    浏览器兼容性和布局
    Java中HashMap等的实现要点浅析
    关于js异步上传文件
    填充路径时所使用的 “非零环绕规则”
    XP极限编程
    假如森林里有一棵树倒下了
  • 原文地址:https://www.cnblogs.com/kunpengit/p/2647654.html
Copyright © 2011-2022 走看看