天天看點

關于extjs

擷取頁面grid方法

var topGrid = button.up("window").down('grid[name=top]');           

//選擇店鋪資訊之後 才能點選确定按鈕 否則無法點選

{
    iconCls : 'accept',
    text:'确定',
    scope : me,
    tooltip : '選擇店鋪的資訊',
    id : "comSelectshopinfo",
    disabled : true,
    handler:me.selectShops  }

listeners:{
      'selectionchange': function(view, records) {
        Ext.getCmp('comSelectshopinfo').setDisabled(!records.length);
        }
          }
           

//頁面顯示字段添加顔色

return '<span style="color:green;">在售</span>';           

//選擇按鈕隐藏 點選一下顯示 再次點選選擇 再次點選會繼續隐藏

Ext.require("AM.view.plugin.ThreeStateCheckbox");
{xtype: 'threeStateCheckbox',name : 'filter_EQ_S_hasmatch',labelWidth : 60,inputValue: "Y",uncheckedValue: "N",fieldLabel : '是否比對',flex:1},           

//擷取grid的id

var poid = me.pogrid.getSelectionModel().getSelection()[0].get('id');           

//隐藏id,如需用到id 則必須在頁面上寫上

{
    header : 'ID',
    dataIndex : 'id',
    flex : 1,
    hidden : true
},           

//擷取tbar中輸入框的值 其中me.grid就是tbar在的目前grid

tbar: [{
            xtype    : 'textfield',
            name     : 'field1',
            emptyText: 'enter search term'
        }]

var tbarText  = me.grid.down('toolbar').down('textfield').getValue();           
me.progrid.getSelectionModel().getSelected()           
這個是擷取選中行的  
           
renderer :function(v){return                scinfo.getValue("MARKET_SUPERPOSITE_STATUS",v);}           
上一篇: ExtJS Viewport
下一篇: ExtJS 4.0