View Full Version : Dynamic title on LayoutDialog

16 Aug 2007, 11:35 AM
Hi folks,

I have a grid with data returned from sql query.
On double click at selected row it appear layout dialog.
My question is how to make the layout title dynamic and corresponding to selected row???
I suppose that I should use setTitle, but i don't know how to retrieve the needed data.

Here is the code I use to get the id of selected row:

var idValue = dataStore.data.items[rowIndex].id;

Below is the variable I try to assign unlucky.

var titleValue = ???

If anyone of you know how to do that, please advice me. Thank you.


16 Aug 2007, 11:51 AM
Cant we get that one with

var titleValue = dataStore.data.items[rowIndex].title;

Sorry if im wrong..

16 Aug 2007, 12:07 PM
I've try that already, but it doesn't work.
Any other ideas...

16 Aug 2007, 12:11 PM
fieldname.setValue(dataStore.getAt(0).data.'your text field in ds');

Tyr this.I m using this one to set fields in form.

16 Aug 2007, 12:20 PM
Great! It works.
Thank you dhanek. I'm appreciate.

19 Aug 2007, 10:51 AM
I found better way to da that:

var titleValue = dataStore.getAt(rowIndex).data.Title;

But now I have another problem.

With each one loading of the dialog, after clicking different rows, the title is the same as the first time loading.

To close the dialog I use:

dialog.addButton('Close', dialog.hide, dialog);

So I've try to destroy the dialog on beforehide event, but I haven't luck :(

Does anyone know how to fix that?

16 Oct 2007, 1:44 PM
I think you have to use iframe to force a refresh each time.