Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Twitter bootstrap TbButton Reset不适用于redactorRow_Twitter Bootstrap_Reset_Redactor - Fatal编程技术网

Twitter bootstrap TbButton Reset不适用于redactorRow

Twitter bootstrap TbButton Reset不适用于redactorRow,twitter-bootstrap,reset,redactor,Twitter Bootstrap,Reset,Redactor,请参阅以下代码: <?php $label = $model->isNewRecord ? 'Create' : 'Update'; $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array( 'id' => 'article-form', 'type' => 'horizontal', )); ?> <fieldset> <legend>

请参阅以下代码:

<?php
$label = $model->isNewRecord ? 'Create' : 'Update';
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id' => 'article-form',
    'type' => 'horizontal',
));
?>
<fieldset>
    <legend><?php echo $label ?> Article</legend>
    <?php
    echo $form->textFieldRow($model, 'title', array('class' => 'span5', 'maxlength' => 200));
echo $form->redactorRow($model, 'content');
?>
</fieldset>
<div class="form-actions">
    <?php $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'label' => $label)); ?>
    <?php $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'reset', 'label' => 'Reset')); ?>
    <?php $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'link', 'url' => url('article/index'), 'label' => 'Cancel')); ?>
</div>
<?php $this->endWidget(); ?>

文章
字段的第一个I类型:标题(文本字段)和内容(编校者) 第二,我点击重置按钮 =>结果:仅标题字段为空文本,不适用于内容

请帮我做这个


谢谢大家,我还没发现问题。 但我有jquery的解决方案

<?php
cs()->registerScript('reset', "
    var firstContent = [];

    $('.redactor_editor').each(function(index, value) {
        firstContent.push($(this).html());
    });

    $(document).ready(function() {
        $('button[type=\'reset\']').click(function() {
            $('.redactor_editor').each(function(index, value) {
                $(this).html(firstContent[index]);
            });
        }); 
    });
", CClientScript::POS_LOAD);
?>