kartik-v

How to update multiple images in kartik Upload widget?

偶尔善良 提交于 2019-12-11 14:07:51
问题 Here i can only able preview the images on update the model. I want to load the images properly so user can remove one r more file and update will work accordingly Here is my controller public function actionUpdate($id) { $model = $this->findModel($id); $session_data = \common\models\Customer::find()->where(['user_id' => $model->customer_user_id])->one(); $towing = \common\models\TowingRequest::find()->where(['id' => $model->towing_request_id])->one(); $images_old = \common\models\Images:

Yii2 gridview - modal only display when click on first row

本秂侑毒 提交于 2019-12-11 08:54:48
问题 I am using kartik\grid\GridView and kartik\grid\ExpandRowColumn to display summary info. On expandRowColumn, I have another gridview to list details info. This part is working fine. Under expandRowColumn gridview I am using modal to view data for column Details. Click modal on first expandRowColumn working fine but got error on other expandRowColumn row. There is no error message but modal is not displaying error_image Gridview on expandRowColumn $gridColumns = [ ['class' => 'yii\grid

Yii2 mPdf Kartik: Set Height and Width Paper

ⅰ亾dé卋堺 提交于 2019-12-11 04:16:15
问题 How to set custom height and width on PDF format like this: I want set height: 13.6cm and width: 21.2cm if I export to PDF, paper size is always in A4 format , how to make paper size to be 13.6cm (height) and **21.2cm (width) as in the picture above I use mpdf kartik on yii2 .. this my controller code: $pdf = new Pdf([ 'mode' => Pdf::MODE_UTF8, 'format' => Pdf::FORMAT_A4, 'destination' => Pdf::DEST_BROWSER, 'content' => $content, 'cssFile' => \Yii::getAlias('@webroot') .'/css/pdf/pdf-pfi.css'

How to use Yii2 kartik gridview editable column with mulitple model relations

半城伤御伤魂 提交于 2019-12-10 17:23:19
问题 Question: I have 2 models, user model and user profile model, both are related with primary and forien key user_id, user table has fields id,username, password, email etc user_profile table has filed id, user_id, company, phone etc I have created gridview in user view. I am using kartik EditableColumn, I want to edit user profile table field company from user gridview. What I have done so far. Please check code what I have done. please note: it is portion of code i am showing here, and I

How to use send the chosen file in Kartik Input File using Ajax?

醉酒当歌 提交于 2019-12-06 07:43:27
I want to use drag & drop upload file using Kartik Input File in my Yii2 application. They said this "drag & drop" input file model need AJAX for send the data. I just following the main code for Kartik Input File from here , and the AJAX from here . I'm new in programming, and I dont know yet how to use AJAX. So I've tried to combine both of code like this in my view.php (path = app/views/students/view.php): <script> $(".btn-success").fileinput({ uploadUrl: 'students/create', // server upload action uploadAsync: true, maxFileCount: 1 }); </script> <?php $form = ActiveForm::begin(['options' =>