ExtJs TreeGridインスタンス

2130 ワード

var searchRstGridPanel = new Ext.grid.GridPanel ({
				 store: new Ext.data.Store({ 
			        
			        proxy: new Ext.data.HttpProxy({
			            url: searchNodeFromLuceneDataUrl
			        }),  //     HttpProxy
			        
			        reader:new Ext.data.JsonReader({
			        	totalProperty: 'totalCount',
	       				idProperty:'nodeId',
	       				root:'data',
	       				remoteSort: true,
	       				
	       				fields: [
			            	'nodeId','nodeName', 'nodeType', 'path'			            
			       		]
			        })
			    }),

			    colModel: new Ext.grid.ColumnModel({
			        defaults: {
			            width: 120,
			            sortable: true
			        },
			        columns: [
			            {id: 'nodeId', header: '  ', width: 200, sortable: true, dataIndex: 'nodeId'},
			            {header: '    ', dataIndex: 'nodeType'},
			            {header: '    ', dataIndex: 'nodeName'},
			            {header: '  ', dataIndex: 'path'}
			        ]
			    }),
			    viewConfig: {
			        forceFit: true,
			
			//      Return CSS class to apply to rows depending upon data values
			        getRowClass: function(record, index) {
			           
			        }
			    },
			    anchor:'100% 300',
			    frame: true,
			    border:false,
			    iconCls: 'icon-grid'
			});

json文字列:
{success:true,'totalCount':'2',data:[{'nodeId':'2c9090652fb50c67012fb51609720002','nodeType':'nd:base','nodeName':'   ','path':'mas'},{'nodeId':'2c9090652fb50c67012fb51a64070005','nodeType':'nd:vod','nodeName':'come','path':'mas/mas'}]}