Hope everything goes well.
I'm developing a custom joomla 1.6 component. Based on user clicks on a tab I want to display some data through a jQuery Ajax call.
The name of the component is
Here goes details.....com_pms
My jQuery Ajax code: executes/triggers when clicks on a button...
Code: Select all
$.ajax({
type: 'POST',
url: 'index.php',
dataType: 'html',
data: 'option=com_pms&task=gcompose',
error: function(xhr, textStatus, errorThrown) {
alert('An error occurred! ' + errorThrown);
},
success: function(data, textStatus) {
stopSpinner("pms_message_content_compose");
$(data).appendTo( '#pms_message_content_compose .no-table' );
lstate_compose = true;
}
});
Code: Select all
function gcompose(){
JRequest::setVar( 'view', 'compose' );
JRequest::setVar( 'layout', 'form' );
parent::display();
}
Code: Select all
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla view library
jimport('joomla.application.component.view');
class PmsViewCompose extends JView
{
// Overwriting JView display method
function display($tpl = null)
{
// Display the view
parent::display($tpl);
}
}
Code: Select all
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
<div>Some text</div>
Any idea would be greatly appreciated..
Thanks,
Rashidul