lundi 12 mai 2014

Elements in cell editor are shifted

Code:



Ext.define('zldapp.view.Viewport', {
extend: 'Ext.Viewport',
alias: ['widget.viewport'],
controllers:['viewport.viewport'],
requires:['zldapp.view.zytab.zyTab'],

initComponent: function() {
var me = this;




Ext.create('Ext.data.Store', {
storeId: 'simpsonsStore',
fields: ['name', 'email', 'phone','work'],
data: {
'items': [{
"name": "Lisa",
"email": "lisa@simpsons.com",
"phone": "555-111-1224",
"work": 0
}, {
"name": "Bart",
"email": "bart@simpsons.com",
"phone": "555-222-1234",
"work": 2
}, {
"name": "Homer",
"email": "home@simpsons.com",
"phone": "555-222-1244",
"work": 1
}, {
"name": "Marge",
"email": "marge@simpsons.com",
"phone": "555-222-1254",
"work": 0
}]
},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});




editorgrid = Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
anchor: '-50',

columns: [{
header: 'Name',
width: 100,
dataIndex: 'name',
editor: 'textfield'
}, {
header: 'Email',
dataIndex: 'email',
width: 100,
editor: {
xtype: 'textfield',
allowBlank: false
}
}, {
header: 'Phone',
dataIndex: 'phone'
}, {
header: 'Work',
dataIndex: 'work',
width: 130,
editor: {
xtype: 'combobox',
typeAhead: true,
triggerAction: 'all',
selectOnTab: true,
store: [
[0,'Engineer'],
[1,'Doctor'],
[2,'Lawyer']
],
lazyRender: true,
listClass: 'x-combo-list-small'
}
}],
selType: 'cellmodel',
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
})],
height: 200,
width: 200,
listeners: {
cellmousedown: function(grid, td, cellIndex, record, tr, rowIndex, e, eOpts){
grid.editingPlugin.startEditByPosition({row: rowIndex, column: cellIndex});
return false;
}
}
});



Ext.apply(me, {
layout: 'border',
title: 'ZyWALL Serial',
id : 'viewport',
items: [{
xtype: 'box',
id: 'header',
region: 'north',
baseCls:'x-panelt',
height:50
},
Ext.create('zldapp.view.treepanel.treepanel')
,{

xtype:'zytab',
header:false,
region:'center',
id: 'content-panel',
bodyStyle: 'background:none;',
layout: 'fit',
border: false,
margins:'0 5 5 0',
items:[
{
id: 'dashboardForm',
header: false,
border: false,
items: [editorgrid]

}

]
}],
renderTo: Ext.getBody()
});

me.callParent(arguments);
}
});




Aucun commentaire:

Enregistrer un commentaire