|
@@ -7,12 +7,11 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
|
|
|
cls: 'x-detailgridfield',
|
|
cls: 'x-detailgridfield',
|
|
|
|
|
|
|
|
border: 1,
|
|
border: 1,
|
|
|
- margin: '0 0 5 0', // formpanel的fieldDefaults未生效
|
|
|
|
|
|
|
+ margin: '0 0 10 0', // formpanel的fieldDefaults未生效
|
|
|
height: 245,
|
|
height: 245,
|
|
|
columnWidth : 1.0,
|
|
columnWidth : 1.0,
|
|
|
|
|
|
|
|
requires: [
|
|
requires: [
|
|
|
- 'Ext.Action',
|
|
|
|
|
'Ext.grid.plugin.CellEditing',
|
|
'Ext.grid.plugin.CellEditing',
|
|
|
'Ext.selection.CellModel'
|
|
'Ext.selection.CellModel'
|
|
|
],
|
|
],
|
|
@@ -27,10 +26,6 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
|
|
|
allowEmpty: false, // 表格为空时校验合法
|
|
allowEmpty: false, // 表格为空时校验合法
|
|
|
showCount: true, // 显示合计栏
|
|
showCount: true, // 显示合计栏
|
|
|
|
|
|
|
|
- // Clearing selection disables the Actions.
|
|
|
|
|
- allowDeselect: true,
|
|
|
|
|
- defaultActionType: 'button',
|
|
|
|
|
-
|
|
|
|
|
initComponent: function() {
|
|
initComponent: function() {
|
|
|
var me = this;
|
|
var me = this;
|
|
|
me.initColumns();
|
|
me.initColumns();
|
|
@@ -44,15 +39,6 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
Ext.apply(me, {
|
|
Ext.apply(me, {
|
|
|
- actions: {
|
|
|
|
|
- copy: {
|
|
|
|
|
- iconCls: 'x-fa fa-copy',
|
|
|
|
|
- text: '复制单元格',
|
|
|
|
|
- handler: function() {
|
|
|
|
|
- me.onCopy(me.selectedData);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
plugins: {
|
|
plugins: {
|
|
|
cellediting: {
|
|
cellediting: {
|
|
|
clicksToEdit: 1,
|
|
clicksToEdit: 1,
|
|
@@ -65,15 +51,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
|
|
|
},
|
|
},
|
|
|
normalViewConfig: {
|
|
normalViewConfig: {
|
|
|
deferEmptyText: false,
|
|
deferEmptyText: false,
|
|
|
- emptyText: '无数据',
|
|
|
|
|
- listeners: {
|
|
|
|
|
- itemcontextmenu: function(view, rec, node, index, e) {
|
|
|
|
|
- e.stopEvent();
|
|
|
|
|
- me.getContextMenu().show().setLocalXY(e.getXY());
|
|
|
|
|
- me.selectedData = e.target.innerText;
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ emptyText: '无数据'
|
|
|
},
|
|
},
|
|
|
lockedGridConfig: {
|
|
lockedGridConfig: {
|
|
|
// scrollable: {
|
|
// scrollable: {
|
|
@@ -486,31 +464,6 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
return trueData;
|
|
return trueData;
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- getContextMenu: function() {
|
|
|
|
|
- var me = this;
|
|
|
|
|
-
|
|
|
|
|
- return me.contextMenu || (me.contextMenu = me.add({
|
|
|
|
|
- xtype: 'menu',
|
|
|
|
|
- items: [
|
|
|
|
|
- // Actions can be converted into MenuItems
|
|
|
|
|
- '@copy',
|
|
|
|
|
- ]
|
|
|
|
|
- }));
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- onCopy: function(text) {
|
|
|
|
|
- var target = Ext.DomHelper.append(document.body, {
|
|
|
|
|
- tag: 'textarea',
|
|
|
|
|
- style: 'opacity: 0;position: absolute;top: -10000px;right: 0;',
|
|
|
|
|
- html: text
|
|
|
|
|
- });
|
|
|
|
|
- target.focus();
|
|
|
|
|
- target.select();
|
|
|
|
|
- document.execCommand('Copy');
|
|
|
|
|
- target.blur();
|
|
|
|
|
- document.body.removeChild(target);
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
});
|
|
});
|