Так я привёл весь код, задействованный в работе. Ну а если нужен полный полный пример, то вот:
<?php
defined('_JEXEC') or die('Restricted access');
$doc = & JFactory::getDocument();
$doc->addStyleSheet('components/com_catalog/files/css/main.css');
$doc->addScript('components/com_catalog/files/js/jquery-1.7.min.js');
?>
<script>
$(document).ready(function(){
tools();
$('a.add').hover(
function(){$(this).find('div').stop().animate({opacity: '1'}, 200);},
function(){$(this).find('div').stop().animate({opacity: '0'}, 200);}
);
$(':checkbox[name=category]').click(function(){
if($(this).is(':checked')) {
$(this).parent().parent().find('ul li input:checkbox[name=subcategory]').attr('checked', 'checked').attr('disabled', 'disabled');
} else {
$(this).parent().parent().find('ul li input:checkbox[name=subcategory]').removeAttr('checked').removeAttr('disabled');
}
tools();
});
$(':checkbox[name=subcategory]').click(function(){
tools();
});
function tools() {
var numCategory = $(':checkbox[name=category]:checked').length;
var numSubCategory = $(':checkbox[name=subcategory]:checked').length;
if(numCategory > 0 || numSubCategory > 0) {
$('.fixBlock.tools').fadeTo('200', 1).find('input:button').removeAttr('disabled');
} else {
$('.fixBlock.tools').fadeTo('400', 0.2).find('input:button').attr('disabled', 'disabled');
}
}
$('.fixBlock.edit input:button').attr('disabled', 'disabled');
$('.fixBlock.edit textarea').attr('disabled', 'disabled');
$('span.editTitle').click(function(){
$('.fixBlock.edit').fadeTo('200', 1).find('input:button').removeAttr('disabled').parent().find('textarea').removeAttr('disabled');
$('.fixBlock.edit textarea').text($(this).text());
$('.fixBlock.edit input[name=editId]').val($(this).parent().find('input:checkbox').attr('value'));
});
$('.fixBlock.edit :button[name=cancelEdit]').click(function(){
$('.fixBlock.edit').fadeTo('400', 0.2);
$('.fixBlock.edit textarea').empty().attr('disabled', 'disabled');
$('.fixBlock.edit input[name=editId]').val('');
$('.fixBlock.edit input:button').attr('disabled', 'disabled');
});
});
</script>
<form method="post" action="index.php">
<div class="comWrapper comTable">
<?php
$cellInRow = '0';
foreach($this->data as $group) {
?>
<?php echo ($cellInRow == '0') ? '<div class="comTableRow">' : ''; ?>
<div class="comTableCell">
<div class="specList">
<div class="clTitle">
<input type="checkbox" name="category" value="<?php echo $group->id; ?>" />
<span class="editTitle"><?php echo $group->category; ?></span>
<a class="add"><div></div></a>
</div>
<?php echo $this->model->subcategory($group->subcategory); ?>
</div>
</div>
<?php
$cellInRow++;
if($cellInRow == '3') {echo '</div>'; $cellInRow = '0';}
}
?>
</div>
<input type="hidden" name="option" value="com_catalog" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="view" value="structure" />
<input type="hidden" name="layout" value="default" />
<div class="fixBlock edit">
<div><textarea name="editName"></textarea></div>
<input type="button" name="edit" value="Сохранить" />
<input type="button" name="cancelEdit" value="Отменить" />
<input type="hidden" name="editId" value="" />
</div>
<div class="fixBlock tools">
<input type="button" name="delete" value="Удалить" />
<input type="button" name="publicToggle" value="Изменить состояние" />
</div>
</form>
Только это слой с вида (компонент для Joomla)