• Ext grid中单元格编辑,editor为combobox时用法


    {
    header: 'TO_PTN_NM',
    dataIndex: "TO_PTN_NM",
    sortable: true,
    renderer: function (v, m, recod, rowindex, colindex) {
    if (true) {
    m.style = " background-color: #ccffcc;";
    };
    return v;
    },
    editor: {
    //xtype: 'textfield', selectOnFocus: true
    xtype: 'combo', selectOnFocus: true,
    forceSelection: false,
    value: '',
    editable: false,
    typeAhead: false,
    store: Ext.create("Scripts.Code.MDM.Logistic.Delivery.DeliveryAttribute.store.HandOverTakeOverReasonStore"),
    //tpl: Ext.create('Ext.XTemplate',
    // '<tpl for=".">',
    // '<div class="x-boundlist-item">{COMM_CODE}:{COMM_CODE_NM}</div>',
    // '</tpl>'
    // ),
    queryMode: 'local',
    //queryParam: 'COMM_CODE',
    valueField: 'COMM_CODE_NM',
    displayField: 'COMM_CODE_NM',
    //hiddenName: 'COMM_CODE',
    matchFieldWidth: false,//此处要有
    listConfig: { 200 },
    listeners: {
    //focus: function (combo, The, eOpts) {
    // var grid = combo.up("grid");
    // var store = grid.getStore("DeliveryAttributeStore");
    // var rowindex = grid.normalGrid.editingPlugin.context.rowIdx;
    // var gridrecord = store.data.items[rowindex];
    // //
    // var delivery = gridrecord.data.TO_GUBUN_CODE;
    // var thisStore = combo.getStore();
    // var obj = new Object();
    // obj.DeliveryKind = delivery;
    // thisStore.proxy.extraParams = obj;
    // thisStore.load();
    //},
    change: function (combo, newValue, oldValue, eOpts) {
    var grid = combo.up("grid");
    var store = grid.getStore("DeliveryAttributeStore");
    var rowindex = grid.normalGrid.editingPlugin.context.rowIdx;//这个grid中有锁定的列 var rowindex = grid.lockedGrid.editingPlugin.context.rowIdx;
    var gridrecord = store.data.items[rowindex];
    gridrecord.set('TO_PTN_CODE', combo.valueModels[0].data.COMM_CODE);
    gridrecord.set('TO_PTN_NM', combo.rawValue);
    //console.log(gridrecord);
    }
    }
    }
    },

    //

    {
    header: "T/O", dataIndex: "TO_CODE",
    renderer: function (value, metadata, record) {
    metadata.style = 'cursor: pointer;';
    metadata.class = "variablediv";
    return "<span style='color:blue;100%' class='TO'>" + value + "</span>";
    }
    },

    cellclick: function (grid, td, cellIndex, record, tr, rowIndex, e, eOpts) {
    var t = e.getTarget();
    record = grid.getStore().getAt(rowIndex);
    var control = t.className;
    if (control == "TO") {
    var TO = record.get("TO_CODE");
    var hasWindow = Ext.ComponentQuery.query("Ali_TODetailInfoWindow");
    var window;
    if (hasWindow.length == 0) {
    window = Ext.create("Scripts.Code.PM.ProdPreparation.TransferOrder.TOPlan.view.TODetailInfoWindow", {
    closeAction: 'destroy'
    });//Ext.widget("Ali_TODetailInfoWindow");
    }
    else {
    window = hasWindow[hasWindow.length - 1];
    };

    window.show();
    var plangrid = window.down('grid[name=syncplan]');
    var planstore = plangrid.getStore();
    planstore.proxy.extraParams = {
    TO: TO
    };
    //planstore.on('load', function () {
    // mergeGrid(plangrid, [1], false);//, 3, 4, 6
    //});
    planstore.loadPage(1);
    var slipgrid = window.down('grid[name=slipstatus]');
    var slipstore = slipgrid.getStore();
    slipstore.proxy.extraParams = {
    TO: TO
    };
    slipstore.loadPage(1);
    //console.log(record);
    var rec = new Object({
    TO_NO: record.data.TO_CODE,
    MODEL_CODE: record.data.MODEL_CODE,
    PO_NO: record.data.PO_CODE,
    MOVE_PLAN_QTY: record.data.PLAN_QTY_CODE,
    MODEL_DESC: record.data.MODEL_NM_CODE
    });
    var form = window.down('form');
    form.getForm().setValues(rec);
    }
    },

  • 相关阅读:
    虚拟主机的陷阱
    http://www.xmenglish.com/(外贸知识网站)
    Highlight Table Row
    让你从电脑维修新手到高手
    Flash 视频教程
    ASP Comparison Operators Logical Operators
    Linux 虚拟机 NAT方式上网设置
    vim技巧
    25 条 SSH 命令和技巧
    linux下添加路由的方法
  • 原文地址:https://www.cnblogs.com/hqyj/p/6991199.html
Copyright © 2020-2023  润新知