ExtJs GridPanel 페이지 나누기

2850 단어 ext
데이터 액세스 도구
var store = new Ext.data.Store({
		        proxy: new Ext.data.HttpProxy({
		            url: searchNodeFromLuceneDataUrl
		        }),
		        
		        reader:new Ext.data.JsonReader({
		        	totalProperty: 'totalCount',
       				idProperty:'nodeId',
       				root:'data',
       				remoteSort: true,
       				
       				fields: [
		            	'nodeId','nodeName', 'nodeType', 'path'
		       		]
		        })
		    });

데이터 새로 고침
function relushDataFunction(start){
				var store = searchRstGridPanel.store;
				store.reload({params:{
					workspaceName:activeWorkspaceName,
					nodeName:Ext.getDom('search_nodeName').value,
					path:Ext.getDom('search_nodePath').value,
					start:start,
					limit:pageSize
				}});
			};

새 gridPanle
var searchRstGridPanel = new Ext.grid.GridPanel ({
				 store: store,
		        trackMouseOver:false,
		        disableSelection:true,
		        loadMask: true,

			    colModel: new Ext.grid.ColumnModel({
			        defaults: {
			            width: 120,
			            sortable: true
			        },
			        columns: [
			        	new Ext.grid.RowNumberer(), //  
			            {header: ' ', dataIndex: 'nodeName'},
			            {header: ' ', dataIndex: 'path'},
			            {header: ' ', dataIndex: 'nodeType'},
			            {id: 'nodeId', header: ' ', width: 200, sortable: true, dataIndex: 'nodeId', align:'center'}
			            
			        ],
			        listeners:{'click':function(){alert()}}
			    }),
			    viewConfig: {
			        forceFit: true,
			        getRowClass: function(record, index) {
			           
			        }
			    },
			    
			    bbar: new Ext.PagingToolbar({
			    	store: store,
			    	displayInfo: true,
			        pageSize: pageSize,
			        prependButtons: true,
                    displayMsg : '  {0}  {1} ,  {2} ',   
                    emptyMsg : " ",
                    doLoad:function(start){
                    	relushDataFunction(start); //  
                    	this.cursor = start; //  
                    }

			    }),
			    anchor:'100%',
			    height:238,
			    frame: true,
			    border:false,
			    iconCls: 'icon-grid'
			    
			});

좋은 웹페이지 즐겨찾기