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.
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.