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>

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM