property-grid.js
上传用户:shuoshiled
上传日期:2018-01-28
资源大小:10124k
文件大小:1k
源码类别:

中间件编程

开发平台:

JavaScript

  1. /*!  * Ext JS Library 3.0.0  * Copyright(c) 2006-2009 Ext JS, LLC  * licensing@extjs.com  * http://www.extjs.com/license  */ Ext.onReady(function(){
  2.     
  3.     var propsGrid = new Ext.grid.PropertyGrid({
  4.         renderTo: 'prop-grid',
  5.         width: 300,
  6.         autoHeight: true,
  7.         propertyNames: {
  8.             tested: 'QA',
  9.             borderWidth: 'Border Width'
  10.         },
  11.         source: {
  12.             '(name)': 'Properties Grid',
  13.             grouping: false,
  14.             autoFitColumns: true,
  15.             productionQuality: false,
  16.             created: new Date(Date.parse('10/15/2006')),
  17.             tested: false,
  18.             version: 0.01,
  19.             borderWidth: 1
  20.         },
  21.         viewConfig : {
  22.             forceFit: true,
  23.             scrollOffset: 2 // the grid will never have scrollbars
  24.         }
  25.     });
  26.     // simulate updating the grid data via a button click
  27.     new Ext.Button({
  28.         renderTo: 'button-container',
  29.         text: 'Update source',
  30.         handler: function(){
  31.             propsGrid.setSource({
  32.                 '(name)': 'Property Grid',
  33.                 grouping: false,
  34.                 autoFitColumns: true,
  35.                 productionQuality: true,
  36.                 created: new Date(),
  37.                 tested: false,
  38.                 version: 0.8,
  39.                 borderWidth: 2
  40.             });
  41.         }
  42.     });
  43. });