Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 6th, 2012  |  syntax: None  |  size: 0.84 KB  |  hits: 34  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Upload Image with Image Title => Yii
  2. <?php
  3. $this->widget('ext.xupload.XUploadWidget', array(
  4.     'url' => Yii::app()->createUrl("site/upload", array("parent_id" => 1)),
  5.     'model' => $model,
  6.     'attribute' => 'file',
  7.     'multiple'=>true,
  8.     'options' => array(
  9.         'beforeSend' => 'js:function (event, files, index, xhr, handler, callBack) {
  10.             handler.uploadRow.find(".file_upload_start button").click(callBack);
  11.             }'
  12.         ),
  13.     ));
  14. ?>
  15. <button id="start_uploads" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-primary">
  16.     <span class="ui-button-icon-primary ui-icon ui-icon-circle-arrow-e"></span>
  17.     <span class="ui-button-text">Start Uploads</span>
  18. </button>
  19. <script type="text/javascript">
  20. $('#start_uploads').click(function () {
  21.     $('.file_upload_start button').click();
  22. });
  23. </script>