PDA

View Full Version : Popping a BasicDialog when Gridrow click



zamkinos
14 Mar 2010, 8:50 AM
hi,
there is a same issue here:
http://www.extjs.com/forum/showthread.php?t=866

but i could not do that.
i have a grid and want to open the dialog window when a row clicked. code is below. i'm getting

Ext.BasicDialog is not a constructorerror.




Ext.onReady(function () {
...
...
var grid = .....
....
grid.addListener("rowclick", yaziyiGoster);

var dialog = new Ext.BasicDialog("comments-dlg", {
autoTabs:true,
width:500,
height:300,
shadow:true,
minWidth:300,
minHeight:300
});
dialog.addButton('Close', dialog.hide, dialog);
dialog.hide();

});

function yaziyiGoster()
{
var selectionModel = Ext.getCmp('gridMakaleler').getSelectionModel();
var record = selectionModel.getSelected();
//var id = grid.getDataModel().getRowId(rowIndex);
dialog.show();

};

there is a div called "comments-dlg" in my aspx page.

<div id="comments-dlg" style="width: 100%; height:100%;"></div>


if i'll open the dialog window, i'll change it's innerHTML but could not open it.
regards.

fay
15 Mar 2010, 5:54 AM
I'm guessing that you're trying to use ExtJS 1.x code in 3.x??? See: http://www.extjs.com/learn/Ext_1_to_2_Migration_Guide#Upgrading_BasicDialog_to_Window

zamkinos
15 Mar 2010, 8:59 AM
I'm guessing that you're trying to use ExtJS 1.x code in 3.x??? See: http://www.extjs.com/learn/Ext_1_to_2_Migration_Guide#Upgrading_BasicDialog_to_Window


yeah you're right. thanks fay.

zamkinos
17 Mar 2010, 5:55 AM
when i click a gridrow, window opens. but when i'm closing it
i'm getting 'undefined variable' error in internet explorer 8 but not in firefox.(in ext-all-debug.js)
rowclick function calls another(yaziyiGoster). is this the problem?
how can i solve this?



Ext.onReady(function () {
......
grid.addListener("rowclick", function(grid, rowIndex, e){
yaziyiGoster(grid, rowIndex)}, grid);
......
});
function yaziyiGoster(pGrid, pRowIndex)
{
alert(pGrid.store.getAt(pRowIndex).get('makaleId'));
if(win.hidden)
win.show(this);
};



thanks in advance.