Exemple #1
0
                K("#post-thumbnail").val(url);
            } else {
                alert(data.message);
            }
        },
        afterError : function(str) {
            alert("自定义错误信息: " + str);
        }
    });
    uploadbutton.fileBox.change(function(e) {
        uploadbutton.submit();
    });
});
');
// for tags
AutoCompleteAsset::register($this);
$this->registerJs('
  $(function() {
    function split( val ) {
      return val.split( /,\\s*/ );
    }
    function extractLast( term ) {
      return split( term ).pop();
    }
 
    $( "#post-tags" )
      // do not navigate away from the field on tab when selecting an item
      .bind( "keydown", function( event ) {
        if ( event.keyCode === $.ui.keyCode.TAB &&
            $( this ).data( "ui-autocomplete" ).menu.active ) {
          event.preventDefault();
Exemple #2
0
    return trim(preg_replace('/>\\s+</', '><', ob_get_clean()));
}
?>
            </thead>
            <?php 
$rows = [];
foreach ($details as $index => $detail) {
    $rows[] = renderRow($detail, $index);
}
echo Html::tag('tbody', implode("\n", $rows), ['data-template' => renderRow(new GlDetail(), '_index_')]);
?>

        </table>

        <div class="box-footer">
            <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
        </div>
    </div>

    <?php 
ActiveForm::end();
?>

</div>
<?php 
\yii\jui\AutoCompleteAsset::register($this);
\yii\jui\ThemeAsset::register($this);
\biz\accounting\components\EntryGlAsset::register($this);
biz\tools\BizDataAsset::register($this, ['master' => ['coas' => $dcoas]]);
Exemple #3
0
 /**
  * Renders the widget.
  */
 public function run()
 {
     echo $this->renderWidget();
     $this->registerWidget('autocomplete', AutoCompleteAsset::className());
 }