Ext 메쉬를 사용하여 백그라운드 데이터 표시

2455 단어 ext
var store=new Ext.data.Store({
			proxy: new Ext.data.HttpProxy({url:'/upsserver/label'}),
			reader: new Ext.data.XmlReader(
            {
            	totalRecords: 'TotalRecord',    
              	record: 'LabelMetaData'                       
           	},
         	[
         		{name:'ID'},
			{name: 'LabelDesc'}
			]),
            remoteSort: false    								 
		}); 
 
var sm = new Ext.grid.CheckboxSelectionModel(); // 
var cm=new Ext.grid.ColumnModel([
			sm,
			{header:MetaData.Label.LABEL_TAG_NAME,dataIndex:'LabelName',sortable:true,renderer:getTag},
			{header:MetaData.Label.TAG_META_ID,dataIndex:'LabelId',sortable:true},
			{header:MetaData.Label.LABEL_TAG_CATEGORY,dataIndex:'LabelCategoryName',sortable:true},
			{header:MetaData.Label.LABEL_CREATE_OR_MOD_TIME,dataIndex:'CreatLabelTime',sortable:true/*, renderer: getMyDate*/},
			{header:MetaData.Label.LABEL_OPEN_TO_PLAT_OR_NOT,dataIndex:'IsPlatformDisplay',sortable:true, renderer: getIsPlatformDisplay},
			{header:MetaData.Label.LABEL_TAG_STATUS,dataIndex:'LabelStutas',sortable:true,renderer: getStatusDesc}
		]); 
 
var grid = new Ext.grid.GridPanel({ 				
			enableHdMenu: false,
			store:store,
			cm:cm,
			sm:sm,
			renderTo:'tableDiv',
			autoExpandColumn:2, 
			autoHeight:true, 
			enableColumnMove:false,
		    shadow:true,
			stripeRows:true,
			//sm:new Ext.grid.RowSelectionModel({singleSelect:true}),
			view:new Ext.grid.GridView({
				forceFit:true,
				emptyText:MetadataRes.NO_RECORD
			}),
			tbar :[],
			bbar: new Ext.PagingToolbar({ 
		        pageSize: limitNumber, 
		        store:store, 
		        displayInfo: true, 
		        displayMsg: CommonRes.BBAR_TEXT, 
		        emptyMsg: CommonRes.NO_RECORD
		    })
		});	
 
store.on('beforeload', function(){
            store.baseParams = {
                labelName: tagNameTxt.getValue().split(/\s{1,}/).join(),
                tagId: StringUtil.trim(tagIdTxt.getValue())
             };
        });

좋은 웹페이지 즐겨찾기