How Do I Register Custom jQuery Css

I am trying to use a custom jQuery css. I have tried registerig just the css file


    Yii::app()->clientScript->registerCoreScript('jquery');

    Yii::app()->clientScript->registerCoreScript('jquery.ui');

    //Yii::app()->clientScript->registerCssFile(Yii::app()->clientScript->getCoreScriptUrl().'/jui/css/base/jquery-ui.css');

    Yii::app()->getClientScript()->registerCssFile(Yii::app()->baseUrl.'/css/jquery-ui-1.8.21.custom');



This results in a dialog without any style from the style sheet.

I also have tried registering the js and css


$jquery = Yii::app()->baseUrl.'/js/jquery-ui-1.8.21.custom/js/jquery-1.7.2.min.js';

$jqueryCss = Yii::app()->baseUrl.'/js/jquery-ui-1.8.21.custom/css/custom-theme/jquery-ui-1.8.21.custom.css';

Yii::app()->clientScript->registerScriptFile($jquery);

Yii::app()->clientScript->registerCssFile($jqueryCss);

This results in no jquery being registered.

What am I missing?

Just this morning I needed to use a different stylesheet for the datepicker widget, since the section I am working on uses a different theme than my main application. I did it like this:




    'filter'=>$this->widget('zii.widgets.jui.CJuiDatepicker', array('model'=>$model, 'attribute'=>'date', 'options' => array('dateFormat' => 'yy-mm-dd'), 'themeUrl' => 'themes/label/css/', 'theme' => 'ui',), true)



You can set 'themeUrl and ‘theme’ in the CJui options array. I simply place my UI css files in the themes/label/css/ui/ directory, so essentially wherever you want to store the CSS files will do.

I am not using a widget or cjui. I am registering the the js and css.

You say you are using a dialog. Why not just use the built in dialog widget? It registers the files itself.

I need to simply open a url with dynamic content. I was unable to either get the ajaxLink to work or load the url using cjui dialog. So I added a simple function


$(function() {

	var $dialog = $('<div id="inventory-details"></div>');

	$dialog.dialog({

		title: 'Invetory Details',

		autoOpen: false,

		modal: true,

		position: ['center', 'top'],

		width: 'auto',

		height: 'auto',

	});


	$('table.items a').click(function() {

		$dialog.load($(this).attr('href')).dialog('open');

		return false;

	});

		

	$('.ui-widget-overlay').live('click', function() {

		$('#inventory-details').dialog( "close" );

	});

});

and registered the jQuery


Yii::app()->clientScript->registerCoreScript('jquery');

Yii::app()->clientScript->registerCoreScript('jquery.ui');

Yii::app()->clientScript->registerCssFile(Yii::app()->clientScript->getCoreScriptUrl().'/jui/css/base/jquery-ui.css');

figuring it would be easy enuf to use registerCssFils to point to my Theme Roller css.

Did you find a solution to this?