bacteria_
4 Oct 2007, 9:36 AM
Hi,
i dont speak english very well (sorry)
i have an grid with many rows...
and this function on double click in row...
grid.on('rowdblclick', dblclick, grid);
function dblclick (grid, rowIndex, e) {
var selectedId = ds.getAt(rowIndex).id;
};
i need create in same page style popup, to open form and edit values,
i trying to use LayoutDialog and i dont have success,
anywhere can help me to construct my LayoutDialog to edit row values ???
thanks.
##### VERSAO PORTUGUES #####
Ola pessoal,
criei um datagrid, ate aqui tudo funciona uma maravilha, porem nao estou conseguindo fazer o esquema de editar o item quando o usuario da um duplo clique, estou tentando usar LayoutDialog mais nao estou tendo sucesso.
alguem pode me ajudar a construir esse LayoutDialog ????
obrigado.
bacteria_
5 Oct 2007, 7:45 AM
i solved my problem,
thanks!
riets003
9 Oct 2007, 12:22 PM
I'm happy for you.. May be you want to help someone else with your solution. If it was a problem for you it might be for somene else. You have the power to help others by posting your solution :)
lyardson
9 Oct 2007, 12:41 PM
same problem for me,
can u pls post the solution.
Aaryn015
9 Oct 2007, 8:43 PM
Hi Guys,
I just did this with the help of others on this forum so I will share what I have done so far.
This will open a dialog, copied from the ExtJS Examples, when a row is double clicked.
It is slightly modified so the animation of the dialog opening centers on the selected row in the grid.
1. In your "init :" method for your grid, AFTER grid.render(), add this:
var o = this;
grid.on('rowdblclick', function(grid, rowIndex, e) {
o.showDialog();
});
2. IMPORTANT: Find the closing brace for your init method, and add a comma beside it.
3. Go to a new line after than and add this method:
showDialog : function(){
if(!dialog){ // lazy initialize the dialog and only create it once
dialog = new Ext.LayoutDialog("hello-dlg", {
modal:true,
width:600,
height:400,
shadow:true,
minWidth:300,
minHeight:300,
west: {
split:true,
initialSize: 150,
minSize: 100,
maxSize: 250,
titlebar: true,
collapsible: true,
animate: true
},
center: {
autoScroll:true,
tabPosition: 'top',
closeOnTab: true,
alwaysShowTabs: true
}
});
dialog.addKeyListener(27, dialog.hide, dialog);
dialog.addButton('Submit', dialog.hide, dialog);
dialog.addButton('Close', dialog.hide, dialog);
var layout = dialog.getLayout();
layout.beginUpdate();
layout.add('west', new Ext.ContentPanel('west', {title: 'West'}));
layout.add('center', new Ext.ContentPanel('center', {title: 'The First Tab'}));
// generate some other tabs
layout.add('center', new Ext.ContentPanel(Ext.id(), {
autoCreate:true, title: 'Another Tab', background:true}));
layout.add('center', new Ext.ContentPanel(Ext.id(), {
autoCreate:true, title: 'Third Tab', closable:true, background:true}));
layout.endUpdate();
}
var sel = grid.getSelectionModel().getSelected();
var selIndex = ds.indexOf(sel);
dialog.show(grid.getView().getRow(selIndex));
} // END showDialog
4. The "hello-dlg" you see in the 4th line above is the id of the hidden div element on your html page. Here is mine:
<div id="hello-dlg" style="visibility:hidden;">
<div class="x-dlg-hd">Layout Dialog</div>
<div class="x-dlg-bd">
<div id="west" class="x-layout-inactive-content">West</div>
<div id="center" class="x-layout-inactive-content" style="padding:10px;">
<p>This dialog has the Vista theme applied.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna. Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit. Quisque dolor magna, ornare sed, elementum porta, luctus in, leo.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna. Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit. Quisque dolor magna, ornare sed, elementum porta, luctus in, leo.</p>
</div>
</div>
</div>
That should do the trick. I am trying to put a form on mine, but haven't got that far yet. I'm rather new to ExtJs, but post here if you need a hand and I will try to help.
Cheers
Aaryn
Mickael
6 Nov 2007, 5:50 AM
I've got an error : dialog is "undefined".
Could you help me ?
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.