PDA

View Full Version : A problem with "Save" button position in Ext.grid.plugin.RowEditing



jmaxt
10 Feb 2012, 5:14 AM
Hi.
I have a problem with Ext.grid.plugin.RowEditing.
I have my class ('Weld.jkh.WRepair') which extend a Ext.window.Window and Ext.grid.Panel, placed to it.
First time opened dialog works ok: I can edit rows in my grid with.
Next,i close window, called close(). And if i open new window, which I created with

var editDialog = new Ext.create('Weld.jkh.WRepair',{
listeners:{
beforeclose:function(){
Ext.getCmp('remontListGrid').getStore().load();
}
}
});
editDialog.show();

(Ext.js version is 4.0.7)
I can't see "Save" button in row editor.
31586

Are you has any ideas about this?

mitchellsimoens
10 Feb 2012, 6:26 AM
Moved from Bugs forum to Q&A as you are asking a question.

When you close your window, is it destroyed?

jmaxt
10 Feb 2012, 8:23 AM
No. I call close() only. I tried to add destroy() after close(), but this is not solve problem.

mitchellsimoens
10 Feb 2012, 8:29 AM
close() by default will destroy the window

leonardodaza
6 Apr 2012, 2:25 PM
I used too Extjs 4.0.7.

I think the solution is set the position on render the editor, but i dont know where? Wich your opinion?

Take a look how appears to me...33719

leonardodaza
6 Apr 2012, 2:57 PM
The problem is not position. Is missconfiguration of editor, in my case dont show the editors fields.

I think the problem is at the editors grid, beacause this fails to me at windows and panels with grids.

Help me please...:((

Thanks in advance!


I used too Extjs 4.0.7.

I think the solution is set the position on render the editor, but i dont know where? Wich your opinion?

Take a look how appears to me...33719

jmaxt
3 Apr 2013, 6:10 AM
Hi! I faced with similiar problem again.
Now i use extjs - 4.2.0.663.
I can't see both buttons ('save'&'cancel') if my grid contains one row and grid does not have 'height' property.
I had not set up 'height' because i want expand component when rows added (no scroll).

<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>RowEditiong grid's plugin bug demo</title>
<link rel="stylesheet" href="ext/ext-theme-classic-all.css">
<script src="ext/ext-dev.js"></script>
</head>
<body>
<script>
Ext.onReady(function(){

var gridToolBar = Ext.create('Ext.toolbar.Toolbar', {
items : [ {
xtype : 'button',
text : 'Добавить',
id:'addDeloDeliveryRow'
}, {
xtype : 'button',
text : 'Удалить',
handler : function() {
console.log('удалить');
}
} ]
});

var storeDeliveryPossibility = Ext.create('Ext.data.Store',{
storeId:'StoreDepartment',
fields:['id','name'],
data : [
{"id":"0", "name":"one"},
{"id":"1", "name":"two"},
{"id":"2","name":"three"},
{"id":"3","name":"etc."}
]
});
var deliveryGrid = Ext.create('Ext.grid.Panel', {
stateful: true,
renderTo:Ext.getBody(),
dockedItems : [ gridToolBar ],
id:'deliveryGrid',
store : Ext.create('Ext.data.Store',{
fields: ['fund', 'opis','delo','fio','birthYear','listCount','deliveryPossibility','dateOfReturn','defaultReason'],
storeId:'StoreDeliveryDelo',
data : [
{"fund":"558", "opis":"1","delo":"1","fio":"Ivanoff", "birthYear":"1931","listCount":"2","deliveryPossibility":"2","dateOfReturn":"2013-05-10","defaultReason":"default reason default reason default reason reason default reason default default reason reason reason reason default default retasdf aj"}
]
}),
forceFit : true,
selType: 'rowmodel',
plugins: [
Ext.create('Ext.grid.plugin.RowEditing', {
clicksToEdit: 2,
height:50
})
],
viewConfig: {
stripeRows: true,
},
columns : [ {
dataIndex : 'fund',
text : 'Фонд',
editor:{
xtype:'numberfield',
allowBlank:false
}
}, {
dataIndex : 'opis',
text : 'Опись',
editor:{
xtype:'textfield',
allowBlank:false
}
}, {
dataIndex : 'delo',
text : 'Дело',
editor:{
xtype:'textfield',
allowBlank:false
}
}, {
dataIndex : 'fio',
text : 'ФИО',
editor:{
xtype:'textfield',
allowBlank:true
}
}, {
dataIndex : 'birthYear',
text : 'Год рождения',
editor: {
xtype: 'datefield',
allowBlank: true
}
}, {
dataIndex : 'listCount',
text : 'Количество листов',
editor:{
xtype:'numberfield',
allowBlank:true
}
}, {
dataIndex : 'deliveryPossibility',
text : 'Возможность выдачи',
editor: {
xtype: "combobox",
store: storeDeliveryPossibility,
displayField: "name",
valueField: "id",
queryMode: "local",
editable:false
},
renderer:function(value,metaData,rec,rowIndex,colIndex,store){
var gridLink = metaData.column.ownerCt.ownerCt;
var comboEditColumn = gridLink.columns[6];
var comboEditor = comboEditColumn.getEditor();
if (!value){
return value;
}
return comboEditor.getStore().data.get(value).data.name;
}
}, {
dataIndex : 'dateOfReturn',
text : 'Дата возврата (факт.)',
editor:{
xtype:'datefield',
allowBlank:false
}
}, {
dataIndex : 'defaultReason',
text : 'Причина невозврата',
// tdCls:'gridCellWrap',
editor:{
xtype:'textfield',
allowBlank:true
}
} ]
});
});
</script>


</body>

</html>42876