CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Master Child Table using JQuery Dialog & Ajax

Print topic Send  topic

Author Message
dinesh

Posts: 8
Posted: 08/14/2011, 1:44 AM

Hi All,

I'm trying to convert my Master Child tables to JQuery dialogs.

Here's what I'm trying to achieve.

My codes are generated using CodeCharge's Application Builder. Suppose I have a table called countries, codechage would generate a grid called countries_list.php and countries_maint.php.

I've modified my countries_list.php to include a button called "Add Country". I've given this button an id called "ShowDialog".

I've alos modified my countries_maint.php to include "jquery.form.js". When the form is submitted, I close the dialog from it's parent.


I've got the following code in countries_list.php :-

<script language="JavaScript" type="text/javascript">
$(document).ready(function(){
$('<div id="Dialog">').dialog({
autoOpen: false,

modal: true

});

$('#Dialog').load( "countries_maint.php", function(data){
dlgTitle=$(data).filter('title').text();

$(this).dialog('option','title' , dlgTitle);
});


$("#ShowDialog").click(function() {
$("#Dialog").dialog('open');
return false;
});

});
</script>

and the folowing code in countries_maint.php :-

<script language="JavaScript" type="text/javascript">
$(document).ready(function(){
$('#country').ajaxForm();
$('#country').submit(function() {
window.parent.$('#Dialog').dialog('close');
});
});
</script>

Everything works fine. I click on the "Add Country" button, the dialog pops up. I fill it and hit the "Add" button (SUBMIT), it closes. And that's great.

Now... when the dialog closes, I'd like the countries_list.php page to update itself.

...so I enclose the countries_list grid in an Ajax Panel... and everything goes wrong!!!

I've added the following code in my countries_list.php

$('#Dialog').bind('dialogclose', function(event) {
AjaxPanel.reload($("Panel1"));
alert('dialog close');
});

when I add an update panel... clicking on the "Add Country" button does'nt trigger the ShowDialog's click function. (I tried to put an alert statement to see if it triggers)

I've tried moving the update panel to below the grid... and the click still doesn't trigger.

When I add the update panel, 2 javascripts are added by codecharge. "js/pt/prototype.js" and "js/pt/ajaxpanel.js". If I remove "prototype.js", the click works, but I can't get the panel to update.

I tried updating the prototype.js and even adding "$.noconflict", but the click doesn't trigger.

Any suggestions anyone?

Thanx in advance.
Dinesh
View profile  Send private message
mamboBROWN


Posts: 1713
Posted: 10/02/2011, 1:07 PM

dinesh,

Have you made any headway with this yet?
View profile  Send private message
dinesh

Posts: 8
Posted: 12/04/2011, 9:21 PM

Sorry for late reply.

No... I've not solved this. As a result I shelved the project. Now trying to revitalise it... but still having same problem. Very frustrating.
View profile  Send private message
mamboBROWN


Posts: 1713
Posted: 12/10/2011, 4:10 PM

dinesh,

I can't make any promises but if I have time I will take a look at this and see if I can come up with something.
View profile  Send private message
dinesh

Posts: 8
Posted: 12/11/2011, 6:13 PM

That's great. Have'nt been able to resolve it. Looking forward to hearing from you soon. Thanx
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.