1. 程式人生 > >Ext.js雙擊事件

Ext.js雙擊事件

/**
 * 聯絡人列表panel
 */
Ext.define('Op.OpBill.OpBillCustLinkGridPanel', {
    extend: 'Ext.grid.Panel',
    id: 'Op_OpBill_OpBillCustLinkGridPanel_ID',
    title: '聯絡人資訊',
    frame: true,
    height: 300,
    sortableColumns: false,
    enableColumnHide: false,
    enableColumnMove: false,
    selType: "rowmodel",
    selModel: Ext.create(
'Ext.selection.CheckboxModel', { mode: "SINGLE" }), loadValuationStore: function(parentCode) { this.getStore().load(); }, constructor: function(config) { var me = this; me.store = Ext.create('Op.OpBill.OpBillCustLinkStore'); me.tbar = []; me.columns
= [{ hidden: true, text: 'id', dataIndex: 'id' }, { text: '聯絡人', dataIndex: 'custLinkman' }, { text: '聯絡人手機號', dataIndex: 'custMobile' }, { text: '所在省', dataIndex:
'custProName' }, { text: '所在市', dataIndex: 'custCityName' }, { text: '所在區', dataIndex: 'custCountyName' }, { text: '所在街道', dataIndex: 'custStreetName' }, { text: '詳細地址', dataIndex: 'custAddress', renderer: function(value, meta, record) { meta.tdAttr = 'data-qtip="' + value + '"'; return value; } }, { text: '經緯度', dataIndex: 'jingwei' }]; var cfg = Ext.apply({}, config); me.callParent([cfg]); }, listeners:{ itemdblclick:function(dataview, record, item, index, e){ var form = Ext.getCmp('Op_OpBill_OpBillForm_ID').form; form.findField('sendName').setValue(record.data.custLinkman); form.findField('sendAddress').setValue(record.data.custAddress); Ext.getCmp('OpBill_OpBillCustLinkWindow_ID').close(); }, } });