yii框架中的cjuidatepicker小部件
我是Yii框架的新手。我发布了这么多次,但没有回复。 我使用yii框架中的cjuidatepicker小部件,yii,Yii,我是Yii框架的新手。我发布了这么多次,但没有回复。 我使用cguidatepicker小部件在注册表中设置了日期字段。 这个小部件在静态页面中工作得很好,但是当我在弹出窗口中使用它时,这个小部件不会出现 <?php echo CHtml::link('Add Client ', "", array( 'style'=>'cursor: pointer; font-size:20px; text-decoration: underl
cguidatepicker
小部件在注册表中设置了日期字段。
这个小部件在静态页面中工作得很好,但是当我在弹出窗口中使用它时,这个小部件不会出现
<?php
echo CHtml::link('Add Client ', "",
array(
'style'=>'cursor: pointer; font-size:20px; text-decoration: underline;',
'onclick'=>"{addclient(); $('#dialogclient').dialog('open');}"
)
);
?>
如有任何建议,将不胜感激
<?php
echo CHtml::link('Add Client ', "",
array(
'style'=>'cursor: pointer; font-size:20px; text-decoration: underline;',
'onclick'=>"{addclient(); $('#dialogclient').dialog('open');}"
)
);
?>
打开一个弹出对话框的链接,其代码在这里
<?php
echo CHtml::link('Add Client ', "",
array(
'style'=>'cursor: pointer; font-size:20px; text-decoration: underline;',
'onclick'=>"{addclient(); $('#dialogclient').dialog('open');}"
)
);
?>
更新编辑:
使用url从.php呈现/打开a_的代码
<?php
echo CHtml::link('Add Client ', "",
array(
'style'=>'cursor: pointer; font-size:20px; text-decoration: underline;',
'onclick'=>"{addclient(); $('#dialogclient').dialog('open');}"
)
);
?>
<script type="text/javascript">
// here is the magic
function addclient()
{
<?php echo CHtml::ajax(array(
**'url'=>array('client/create'),**
'data'=> "js:$(this).serialize()",
'type'=>'post',
'dataType'=>'json',
'success'=>"function(data)
{
if (data.status == 'failure')
{
$('#dialogclient div.divForForm').html(data.div);
// Here is the trick: on submit-> once again this function!
$('#dialogclient div.divForForm form').submit(addclient);
}
else
{
$('#dialogclient div.divForForm').html(data.div);
setTimeout(\"$('#dialogclient').dialog('close') \",3000);
}
} ",
))
?>;
return false;
}
</script>
我猜cjuidatepicker小部件的导入代码不在新的弹出窗口中。当弹出窗口打开时,转到源代码,查看是否所有js导入都在那里?我猜cjuidatepicker小部件的导入代码不在新的弹出窗口中。当弹出窗口打开时,转到源代码,查看是否存在所有js导入?当您在弹出窗口上呈现页面时,使用带有以下标志的
renderPartial
,将第四个参数processOutput
设置为true
<?php
echo CHtml::link('Add Client ', "",
array(
'style'=>'cursor: pointer; font-size:20px; text-decoration: underline;',
'onclick'=>"{addclient(); $('#dialogclient').dialog('open');}"
)
);
?>
$this->renderPartial('view',array('model'=>$model),false,true);
<?php
echo CHtml::link('Add Client ', "",
array(
'style'=>'cursor: pointer; font-size:20px; text-decoration: underline;',
'onclick'=>"{addclient(); $('#dialogclient').dialog('open');}"
)
);
?>
在弹出窗口上呈现页面时,使用带有以下标志的
renderPartial
,将第四个参数processOutput
设置为true
<?php
echo CHtml::link('Add Client ', "",
array(
'style'=>'cursor: pointer; font-size:20px; text-decoration: underline;',
'onclick'=>"{addclient(); $('#dialogclient').dialog('open');}"
)
);
?>
$this->renderPartial('view',array('model'=>$model),false,true);
<?php
echo CHtml::link('Add Client ', "",
array(
'style'=>'cursor: pointer; font-size:20px; text-decoration: underline;',
'onclick'=>"{addclient(); $('#dialogclient').dialog('open');}"
)
);
?>
:我用于呈现url中使用的页面的代码。我如何使用renderpartial()方法在dialog pop中呈现页面?:我用于呈现url中使用的页面的代码。我如何使用renderpartial()方法在dialog pop中呈现页面。我如何检查js导入…?请在此处添加弹出窗口的源代码?所以很容易找出错误在哪里。@Muhahid…请在我的问题actioncreate()中查看我的新编辑…thankshow我可以检查js导入吗…?您可以在这里添加弹出窗口的源代码吗?所以很容易找出错误在哪里。@Muhahid…请在我的问题actioncreate()中查看我的新编辑…谢谢
<?php
echo CHtml::link('Add Client ', "",
array(
'style'=>'cursor: pointer; font-size:20px; text-decoration: underline;',
'onclick'=>"{addclient(); $('#dialogclient').dialog('open');}"
)
);
?>