extjs 怎么让密码在grid 以****的形式显示啊

解决方案 »

  1.   

     var cm = new Ext.grid.ColumnModel({
            // specify any defaults for each column
            defaults: {
                sortable: true // columns are not sortable by default           
            },
            columns: [
                {
                    id: 'common',
                    header: 'Common Name',
                    dataIndex: 'common',
                    width: 220,
                    // use shorthand alias defined above
                    editor: new fm.TextField({
                        allowBlank: false,
                        inputType : 'password'
                    })
                }, {
                    header: 'Light',
                    dataIndex: 'light',
                    width: 130,
                    editor: new fm.ComboBox({
                        typeAhead: true,
                        triggerAction: 'all',
                        // transform the data already specified in html
                        transform: 'light',
                        lazyRender: true,
                        listClass: 'x-combo-list-small'
                    })
                }, {
                    header: 'Price',
                    dataIndex: 'price',
                    width: 70,
                    align: 'right',
                    renderer: 'usMoney',
                    editor: new fm.NumberField({
                        allowBlank: false,
                        allowNegative: false,
                        maxValue: 100000
                    })
                }, {
                    header: 'Available',
                    dataIndex: 'availDate',
                    width: 95,
                    renderer: formatDate,
                    editor: new fm.DateField({
                        format: 'm/d/y',
                        minValue: '01/01/06',
                        disabledDays: [0, 6],
                        disabledDaysText: 'Plants are not available on the weekends'
                    })
                },
                checkColumn // the plugin instance
            ]
        });
      

  2.   

    inputType : 'password'
    楼上正解 问题是你既然不让人看到为何把密码放出来显示
    很不安全
      

  3.   

    如果一定要显示,并且一定要显示成***的话,写个renderer吧,renderer : function(value) {return "******";}