PDA

View Full Version : Newbie Question



pepo
15 Oct 2007, 12:26 AM
Hi, I'm implementing the Layout dialog for my website. Being new to Javascript, I'm not sure how to achieve the following:

I want to assign a parameter to the "Show Dialogue" button. The "Show Dialog" button obviously opens the dialog window with the cool slide-out effect. This parameter represents the record_id of a database record which I'm looping through. So, if there are 5 records in the database, I want 5 separate "Show Dialog" buttons each ready to pass its record_Id to the dialog box, so that the when the dialog box loads, it displays information related to the Record_Id passed to it. The record_id would be passed in the URL or whatever other way is suitable.

I can take care of the looping using cold fusion, I just need to know how to pass a database record_id to the "Show Dialog" button/link and then how to display the appropriate record details in the dialog box depending on what record_id was passed.

I hope I made sense. Many thanks for any assistance.


Edited to add the following:

Here is the code I have added in the examples/dialog/layout.js file to load a URL into the dialog:

layout.add('center', new Ext.ContentPanel('center', {title: 'Sale Details',url: {url: 'http://www.mysite.co.nz/dsp-top5.cfm', scripts: true} }));

I guess I can add the record_id parameter to the URL parameter as follows:

{url: 'http://www.mysite.co.nz/dsp-top5.cfm?ID=PASSED_ID', scripts: true}

where PASSED_ID would be the record_id assigned to the ShowDialog button. So, I guess I just need to know how to dynamically populate this value (PASSED_ID) in the JS file.

Animal
15 Oct 2007, 1:45 AM
Just a heads up for you before I or anyone dives in to help.

You should really be using Ext 2.0 and an Ext.Window in new developments. An Ext.Window always has a layout, you can easily specify Panels that it should contain in its config object that you pass to its constructor.

You will find it much easier and more intuitive. Basically, in Ext 2.0, one statement containing the correct config options will set up your Window.

pepo
15 Oct 2007, 11:04 AM
I didn't see the Window. Now that I've seen it, I'll definitely use it. But the problem is the same.

After looping through database records: Assigning database record_id to the Show Window button, which the button then passes to the window it opens, so that the window can display record-specific information.

How do I pay for Premium Help? Can't find a link anywhere.

Animal
15 Oct 2007, 11:15 AM
http://extjs.com/store