As the title says, I cannot move or scroll the table right, because there is no horizontal scrollbar. When I actually change the browser's window's width the scrollbars magically appears. However after just loading the page, its not visible at all - screenshoot below (as you can see action column and part of a string is cut out). enter image description here

Here is the view code, however it does not matter at all, simple GridView without any options behaves the same way:

        <?= GridView::widget([
        'options'                 => ['id' => 'job-grid'],
        'dataProvider'            => $dataProvider,
        'filterModel'             => $searchModel,
        'pjax'                    => true,
        'perfectScrollbar'        => true,
        'pjaxSettings'            => [
            'options' => [
                'id'              => 'job_index_pjax',
                'enablePushState' => false,
        'resizableColumns'        => true,
        'resizableColumnsOptions' => ['resizeFromBody' => true],
        'persistResize'           => true,
        'responsiveWrap'          => false,
        'toolbar'                 => [
            ['content' =>
                 . '{toggleData}'
                 . $export
                 . ($createJobButton ?? '')
                 . ($deleteMultipleJobsButton ?? ''),
        'toggleDataOptions'       => GridView::getToggleDataOptions(),
        'panel'                   => [
            'type'  => GridView::TYPE_DEFAULT,
            'after' => Icon::i('info')
                . ' '
                . Yii::t('app', 'Use checkboxes to select items for export. If none selected, currently visible items will be exported. '),

        'columns'                 => [
Csdn user default icon
Yii2:Kartik Gridview导出配置?

<div class="post-text" itemprop="text"> <p>I am using Kartik Gridview. Export is also working fine, but summary data is not getting exported, but showing fine in the view. As also I want to change the filename of the downloaded file.</p> <p>I have tried this code, but nothing seems to be working</p> <pre><code>&lt;?= GridView::widget([ 'dataProvider' =&gt; $dataProvider, 'filterModel' =&gt; $searchModel, 'columns' =&gt; $gridColumns, 'showPageSummary' =&gt; true, 'exportConfig'=&gt; [ GridView::EXCEL=&gt;[ 'filename' =&gt; Yii::t('kvgrid', 'Appointments'), 'showPageSummary' =&gt; true, ] ], ..... </code></pre> <p>That is I have added the <code>export config</code> in the <code>gridview widget</code> but it doesn't seems to be working.</p> <p>What I am doing wrong here? please suggest any changes.</p> </div>

Yii2 GridView CheckboxColumn

<div class="post-text" itemprop="text"> <p>I have a working Yii2 application locally with <code>GridView</code> but immediately I deployed it online, I started having issues with it. Below is the error and the code for the <code>GridView</code>:</p> <blockquote> <p><strong>ReflectionException</strong> Class \kartik\grid\checkBoxColumn does not exist</p> </blockquote> <p><strong><code>View File</code></strong></p> <pre><code>use kartik\grid\GridView; &lt;?= GridView::widget([ 'dataProvider' =&gt; $dataProvider, 'filterModel' =&gt; $searchModel, 'options' =&gt; [ 'class' =&gt; 'table table-responsive' ], 'columns' =&gt; [ ['class' =&gt; 'kartik\grid\checkBoxColumn'], [ 'class' =&gt; 'kartik\grid\ActionColumn', 'header' =&gt; 'Actions', 'headerOptions' =&gt; ['width' =&gt; '40'], 'template' =&gt; '{view}&amp;ensp;{update}' ], ], ]); ?&gt; </code></pre> <p>I have tried to upgrade the version of the Yii2 application but yet I am still getting the same issue meanwhile everything is working fine locally.</p> </div>

两个kartik \ grid \ GridView表共享相同的分页获取变量[重复]

<div class="post-text" itemprop="text"> <div class="question-status question-originals-of-duplicate"> <p>This question already has an answer here:</p> <ul> <li> <a href="/questions/38168203/two-gridviews-in-one-view" dir="ltr">Two GridViews in one view</a> <span class="question-originals-answer-count"> 1 answer </span> </li> </ul> </div> <p>i have two <code>kartik\grid\GridView</code> tables with pagination on same page. When I change page of first table, second table change its page too. They share same <code>$_GET</code> parameter <code>page</code> and <code>per-page</code>.</p> <p>Any option to set pagination get variable names or any other way to solve this problem.</p> <p>Thanks.</p> </div>

是否可以在Yii2 Kartik GridView DataColumn标题中使用 或?

<div class="post-text" itemprop="text"> <p>I have a table with many colomns. It has a big lable strings and smal data strings, like 'Average usage time' and '55',</p> <pre><code>| Average usage time | ______________________ | 55| </code></pre> <p>so i want to show label in a few lines, like </p> <pre><code>| Average| | usage| | time| | _______| | 55 | </code></pre> <p>to fit table into screen. Problem is that DataColumn ignore both ' ' symbol and br tags in label. Is there any way to do this?</p> <p>DataColumn example:</p> <pre><code>[ 'attribute' =&gt; 'avg_usage_time', 'label' =&gt; 'Average &lt;br&gt;usage time', 'vAlign'=&gt;'middle', 'content' =&gt; function($model) { return number_format($model['avg_usage_time'], 0, '.', ' '); }, 'pageSummary' =&gt; function ($summary, $data, $widget) { return (isset($summary) &amp;&amp; is_numeric($summary)) ? number_format($summary, 0, '.', ' ') : 0; }, ], </code></pre> </div>

将类添加到Yii2 CRUD GridView

<div class="post-text" itemprop="text"> <p>I've been trying to add a class to the images' column in the CRUD GridView in Yii2. So far, I've managed to display the image, but at its full width and height. I need to add a 'col-md-3' bs class to the image.</p> <p>This is what I pulled off:</p> <pre><code>&lt;?= GridView::widget([ 'dataProvider' =&gt; $dataProvider, 'filterModel' =&gt; $searchModel, 'columns' =&gt; [ ['class' =&gt; 'yii\grid\SerialColumn'], 'emp_firstname', 'emp_lastname', 'emp_photo' =&gt; [ 'format' =&gt; 'image', 'attribute' =&gt; 'emp_photo', 'value' =&gt; 'emp_photo', 'contentOptions' =&gt; ['class' =&gt; 'col-md-3'], ], ['class' =&gt; 'yii\grid\ActionColumn'], ], ]); ?&gt; </code></pre> </div>


<div class="post-text" itemprop="text"> <p>Well I can filter on any fields including the column from related fields, but I wonder how I can filter on date fields.</p> <p>One solution I came across is date-picker for filter, I have not tested this, but my requirement is little different.</p> <p>for example I have duplicated the <code>datetime</code> column in gridview and formatted it like</p> <pre><code>[ 'attribute'=&gt;'discharge_date', 'format'=&gt;['DateTime','php:M'] ], </code></pre> <p>So that the column will show only months.The column is showing the months correctly. </p> <p>Now I want to filter by month on this column. Any suggestion will be greatly appreciated. Thanks.</p> <p>I did try like this</p> <pre><code>[ 'attribute'=&gt;'discharge_date', 'value'=&gt;'discharge_date', 'filter' =&gt; ['2015-01'=&gt;'Jan','2015-02'=&gt;'Feb','2015-03'=&gt;'Mar'], 'format'=&gt;['DateTime','php:M'] ], </code></pre> <p>This works fine, but here the year is being hard-coded, which I don't want. I know this is not the proper way. Thanks</p> </div>

在Kartik Select2中添加Select2数据选项

<div class="post-text" itemprop="text"> <p>Basically, I using <a href="http://demos.krajee.com/widget-details/select2#settings" rel="nofollow noreferrer">Kartik Select2</a> to create a dropdownlist.</p> <p>If I have a data like this :</p> <pre><code>&lt;?php $mapListNoEstimate = ArrayHelper::map($listNoEstimate, 'id', function ($model, $value) { return $model['no_surat'] . ' - ' . $model['level']; }); </code></pre> <p>In Select2 :</p> <pre><code> echo $form-&gt;field($model, 'repair_estimate_id')-&gt;widget(Select2::className(), [ 'data' =&gt; $mapListNoEstimate, 'theme' =&gt; Select2::THEME_CLASSIC, 'options' =&gt; [ 'placeholder' =&gt; 'Select an estimate ...', 'options' =&gt; [ ] ], ]) </code></pre> <p>, How can we adding some data-attribute ? </p> <p>In my case, I want to add data-level in each option.</p> <p>You know, in legacy select option, we can do like this :</p> <pre><code>&lt;select&gt; &lt;option value='$model["id"]' data-level= '$model["level"]'&gt; $model['no_surat'] . ' - ' . $model['level'] &lt;/option&gt; &lt;/select&gt; </code></pre> <p>Please advise.</p> </div>

startDate和endDate在yii2 kartik插件中的DateRangePicker小部件中不起作用

<div class="post-text" itemprop="text"> <pre><code>DateRangePicker::widget([ 'model' =&gt; $model, 'attribute' =&gt; 'date_range', 'startAttribute' =&gt; 'from_date', 'endAttribute' =&gt; 'to_date', 'convertFormat' =&gt; true, 'presetDropdown' =&gt; true, 'hideInput' =&gt; true, 'value' =&gt; '', 'pluginOptions' =&gt; [ 'locale' =&gt; ['format' =&gt; 'd M Y'], 'endDate'=&gt; date('d-m-Y'), 'startDate'=&gt; date('d-m-Y',strtotime('-6 months')) ] ]); </code></pre> <p>Above is code using which i am date range picker for filter but it is also making future date also selectable.But i want to disable them. I search the google and find the solution that if i put startDate and endDate in plugin option then it will not allow user to select future date. But unable to get the correct result.</p> <p>Composer.json file code</p> <pre><code>{ "name": "yiisoft/yii2-app-advanced", "description": "Yii 2 Advanced Project Template", "keywords": ["yii2", "framework", "advanced", "project template"], "homepage": "http://www.yiiframework.com/", "type": "project", "license": "BSD-3-Clause", "support": { "issues": "https://github.com/yiisoft/yii2/issues?state=open", "forum": "http://www.yiiframework.com/forum/", "wiki": "http://www.yiiframework.com/wiki/", "irc": "irc://irc.freenode.net/yii", "source": "https://github.com/yiisoft/yii2" }, "minimum-stability": "stable", "require": { "php": "&gt;=5.4.0", "yiisoft/yii2": "2.0.13", "yiisoft/yii2-bootstrap": "~2.0.0", "yiisoft/yii2-swiftmailer": "~2.0.0", "kartik-v/yii2-widget-select2": "2.1.0", "kartik-v/yii2-widget-datetimepicker": "^1.4", "aws/aws-sdk-php": "3.36.9", "kartik-v/yii2-widget-growl": "v1.1.1", "kartik-v/yii2-detail-view": "@dev", "ckeditor/ckeditor": "dev-full/4.7.x as 4.7.0", "kartik-v/yii2-widget-sidenav": "v1.0.0", "dmstr/yii2-adminlte-asset": "2.4.4", "kartik-v/yii2-date-range": "1.6.8", "kartik-v/yii2-widget-fileinput": "1.0.5", "kartik-v/yii2-widget-activeform": "v1.4.8", "linslin/yii2-curl": "1.2.0", "kartik-v/yii2-widget-datepicker": "v1.4.3", "vova07/yii2-imperavi-widget": "2.0.2", "yiidoc/yii2-redactor": "2.0.1", "phpmailer/phpmailer": "6.0.5", "yii2tech/csv-grid": "1.0.1", "predis/predis": "1.1.1", "miloschuman/yii2-highcharts-widget": "*" }, "require-dev": { "yiisoft/yii2-debug": "~2.0.0", "yiisoft/yii2-gii": "~2.0.0", "yiisoft/yii2-faker": "~2.0.0", "codeception/base": "^2.2.3", "codeception/verify": "~0.3.1" }, "config": { "process-timeout": 1800, "fxp-asset":{ "installer-paths": { "npm-asset-library": "vendor/npm", "bower-asset-library": "vendor/bower" } } } } </code></pre> </div>


<div class="post-text" itemprop="text"> <p>well I am using Kartik/Detail View and I only want to show the edit and delete button in the panel if the user is Admin. My code is : </p> <pre><code>&lt;?= DetailView::widget([ 'model'=&gt;$model, 'condensed'=&gt;true, 'hover'=&gt;true, 'mode'=&gt;DetailView::MODE_VIEW, 'panel'=&gt;[ 'heading'=&gt;'Empleado ' . $model-&gt;RPE, 'type'=&gt;DetailView::TYPE_INFO, ], 'buttons1' =&gt; '{view}', </code></pre> <p>Doing this im just only hidding the buttons but for everyone and just showing the view button but i don't want this. </p> <p>In my GridView i am doing something like this but in the DeatailView didn't work, so i dont know how to implement this there. </p> <pre><code>['class' =&gt; 'kartik\grid\ActionColumn', 'header' =&gt; 'Acciones', 'template'=&gt; '{view} {update} {delete} ', 'buttons'=&gt; [ 'update'=&gt; function($url,$model) { if (Yii::$app-&gt;user-&gt;isGuest ? FALSE : (Yii::$app-&gt;user-&gt;identity-&gt;isAdmin)) { return(Html::a( '&lt;span class="glyphicon glyphicon-pencil"&gt;&lt;/span&gt;', $url)); } }, 'delete'=&gt;function($url,$model,$key) { if (Yii::$app-&gt;user-&gt;isGuest ? FALSE : (Yii::$app-&gt;user-&gt;identity-&gt;isAdmin)) { return(Html::a('&lt;span class="glyphicon glyphicon-trash"&gt;&lt;/span&gt;', $url)); } }, ], </code></pre> </div>

Yii2 - 403 gridview自定义操作按钮错误

<div class="post-text" itemprop="text"> <p>I am using Yii2 <code>advanced template</code> and I have a ‍‍<code>gridview</code> to display users and in the <code>action</code> column I have added a button to disable users.<br> The default actions work correctly, but I get <code>Forbidden (#403)</code> error when I click on the action I made myself.</p> <p>my gridview action buttons:</p> <pre class="lang-php prettyprint-override"><code>[ 'class' =&gt; 'kartik\grid\ActionColumn', 'template' =&gt; '{view} {update} {delete} {disable}', 'buttons' =&gt;[ 'disable' =&gt; function($url, $model, $key) { return Html::a("" ,$url, ['class' =&gt; "glyphicon glyphicon-ban-circle"]); } ] ], </code></pre> <p>The <code>$url</code> for disable button is <code>site.com/admin/user-register/disable?id=57</code>and I have <code>actionDisable</code> in <code>UserRegisterController</code></p> <p>my <code>actionDisable</code>:</p> <pre class="lang-php prettyprint-override"><code> public function actionDisable($id) { if (Yii::$app-&gt;user-&gt;can('EditMobileUser')) { echo "disable"; } else throw new NotFoundHttpException(); } </code></pre> </div>


<div class="post-text" itemprop="text"> <p>I've a Yii2-basic application that has view of <strong>index.php</strong> that contain a kartik GridView. There is an action column that contain <code>view</code> button that will redirect the page to view of <strong>view.php</strong> if clicked.</p> <p><a href="https://i.stack.imgur.com/RYj3i.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RYj3i.png" alt="enter image description here"></a></p> <p>If the <strong>view</strong> button clicked, page will redirect to <strong>view.php</strong> and show data based on id, </p> <p>For <strong>example</strong> from image above, that table contain two button in <strong>view</strong> column. If the first(top) button clicked, it will show data base on <code>id</code> from <strong>id</strong> column (left side of table), so it will show data that has <code>id = 1</code>. And I've successfully create this action.</p> <p>But I need to show data in <strong>modal box</strong>. So I use <code>yii\bootstrap\Modal</code>. And I've succesfully show the data in <strong>modal box</strong>. For the first clicked, it will popup <strong>modal box</strong> that contain data based on <code>id</code>, but for the next click button it will also show the data based on <code>id</code> that got from the first clicked button.</p> <p>For <strong>example</strong> from picture above: For the first time I click the button from the second row (<code>id = 2</code>) and then popup a <strong>modal box</strong> that contain data that has <code>id=2</code>, and then I click the button from the first row(<code>id = 1</code>) and it will also popup <strong>modalbox</strong> that contain data that has <code>id = 2</code>.</p> <h3>Here's my code from index.php:</h3> <pre><code>&lt;?php use yii\helpers\Html; use kartik\grid\GridView; use yii\widgets\Pjax; use yii\helpers\Url; use yii\bootstrap\Modal; &lt;div class="students-index"&gt; &lt;?= GridView::widget([ 'dataProvider' =&gt; $dataProvider, 'tableOptions' =&gt; ['class' =&gt; 'table table-hover'], 'columns' =&gt; [ [ 'label' =&gt; 'id', 'value' =&gt; function($data) { return $data-&gt;id; } ], [ 'label' =&gt; 'Name', 'value' =&gt; function($data) { return $data-&gt;name; } ], [ 'label' =&gt; 'Birthdate', 'value' =&gt; function($data) { return $data-&gt;Birthdate; } ], [ 'label' =&gt; 'Sex', 'value' =&gt; function($data) { return $data-&gt;Sex; } ], [ 'class' =&gt; 'yii\grid\ActionColumn', 'header' =&gt; 'View', 'template' =&gt; '{view}', 'buttons' =&gt; [ 'view' =&gt; function ($url, $model) { $icon = '&lt;span class="glyphicon glyphicon-eye-open"&gt;&lt;/span&gt;'; return Html::a($icon, $url, [ 'title' =&gt; Yii::t('app', 'View'), 'data-toggle' =&gt; "modal", 'data-target' =&gt; "#myModal", ]); }, ], 'urlCreator' =&gt; function ($action, $model, $key, $index) { if ($action === 'view') { $url = Url::toRoute(['/school/students/view', 'id' =&gt; $model-&gt;faktur_out_id], ['data-method' =&gt; 'post',]); return $url; } } ] ], ]); ?&gt; &lt;/div&gt; &lt;?php Modal::begin([ 'id' =&gt; 'myModal', ]); Pjax::begin([ 'id'=&gt;'pjax-modal','timeout'=&gt;false, 'enablePushState'=&gt;false, 'enableReplaceState'=&gt;false, ]); Pjax::end(); Modal::end(); ?&gt; &lt;?php $this-&gt;registerJs(" $('#myModal').on('show.bs.modal', function (event) { var button = $(event.relatedTarget) var href = button.attr('href') $.pjax.reload('#pjax-modal', { 'url' =&gt; href, }); "); ?&gt; </code></pre> <h3>How do I can show the data in modal box based on id?</h3> <p>But actually I didn't understand <code>$this-&gt;registerJs("......")</code> yet. Maybe anyone can explain about it in simple language.</p> <p>Any help will be appreciated, thanks.</p> </div>

kartik 时间控件如何设置开始时间和结束时间

kartik 时间控件如何设置开始时间和结束时间?????????????

具有两个属性的Kartik DateRangePicker会在范围日期选择中导致invalidDateFormat和NaN

<div class="post-text" itemprop="text"> <p>I've a question about the Kartik DateRangePicker Widget that i use in my gridview for filter some results.</p> <p>in my SearchModel i've created two attributes </p> <pre><code> public $date_start; public $date_end; </code></pre> <p>i use these for filter a field in database 'insert_date'.</p> <p>In my view, as grid configuration, i've set these options</p> <pre><code>[ 'attribute' =&gt; 'insert_date', 'options' =&gt; ['class' =&gt; 'gridview-date-column'], 'filter' =&gt; DateRangePicker::widget([ 'model' =&gt; $searchModel, 'name' =&gt; 'insert_date', 'attribute' =&gt; 'insert_date', 'startAttribute' =&gt; 'date_start', 'endAttribute' =&gt; 'date_end', 'convertFormat'=&gt;true, 'pluginOptions' =&gt; [ 'opens'=&gt;'right', 'locale' =&gt; [ 'cancelLabel' =&gt; 'Clear', 'format' =&gt; 'd-m-Y', ], ] ]), 'format' =&gt; ['date', Yii::$app-&gt;formatter-&gt;datetimeFormat], 'contentOptions'=&gt;['style'=&gt;'min-width: 200px;'] ], </code></pre> <p>By default $date_start and $date_end haven't a value, so , when i enter in my view and try to filter this field i get an 'invalidDate' error and a series of <strong>NaN</strong> on the calendars.</p> <p>This is fixed if i set a value for these two fields or if remove them from the configuration ( so i can only use insert_date attribute as string with these two ranges for filtering ). </p> <p>Looking in the plugin repository i've found the <a href="https://github.com/kartik-v/yii2-date-range/issues/81" rel="nofollow noreferrer">same case</a> and as response of the author</p> <blockquote> <p>This problem occurs because you have an invalid date format for the data that does not match the plugin's format.</p> </blockquote> <p>But as empty these fields can never have a correct data format.</p> <p>Someone had the same problem? Thanks in advance for all the responses.</p> </div>

使用Ajax方法通过Kartik FileInput Yii2小部件成功上传后更新图像时图像为空

<div class="post-text" itemprop="text"> <p>I have a form to update my news post which have title, content and image upload button at the same page. The image uploader use Kartik FileINput widget for Yii2 applying Ajax method. </p> <p>This is my actionUpload that processed the AJAX uploading</p> <pre><code>public function actionUpload($id) { $model = $this-&gt;findModel($id); $currentImage=$model-&gt;image; if (Yii::$app-&gt;request-&gt;isAjax) { \Yii::$app-&gt;response-&gt;format = \yii\web\Response::FORMAT_JSON; $image = $model-&gt;uploadImage(); if($image===false) { //echo "image instance is empty"; $model-&gt;image = $currentImage; } if ($model-&gt;validate() &amp;&amp; $model-&gt;save()) { if($image !== false) { $model-&gt;image = $image-&gt;basename.'.'.$image-&gt;extension; $image-&gt;saveAs('uploads/batam/'.$model-&gt;image); $model-&gt;save(false); return \yii\helpers\Json::encode(array("image" =&gt; $model-&gt;image, )); } } else {echo "validation failed";} } } </code></pre> <p>This is my widget file upload filed in my form (note : it's inside the active form)</p> <pre><code>echo FileInput::widget([ 'name' =&gt; 'image', 'options'=&gt;[ 'multiple'=&gt;false ], 'pluginOptions' =&gt; [ 'uploadUrl' =&gt; Url::to(['news/upload','id'=&gt;$id]), 'uploadExtraData' =&gt; [ 'id'=&gt;$id, ], 'initialPreview'=&gt;[ Yii::getAlias('@web').'/uploads/batam'.$model-&gt;image ], 'initialPreviewAsData'=&gt;true, 'overwriteInitial'=&gt;false, 'maxFileSize'=&gt;2800 ] ]); </code></pre> <p>this is my model rule and uploadImage method</p> <pre><code> public function rules() { return [ [['title', 'content'], 'required'], [['content'], 'string'], [['created_at', 'updated_at'], 'safe'], [['image'], 'file','skipOnEmpty'=&gt;true, 'extensions'=&gt;'jpg,png,jpeg'], [['title'], 'string', 'max' =&gt; 255], ]; } public function uploadImage() { $image = UploadedFile::getInstanceByName('image'); if (empty($image)) { return false; } return $image; } </code></pre> <p>I have 2 issues here that needs help : 1. The validation rules won't work. I can upload any file with any extension and it's succesfully uploaded and updated in the database 2. The image upload was contained within the active form, so after a successful upload using AJAX, when I press 'update' button, the image won't display. The <code>image</code> field is treated as empty, so the <code>update</code> button behave as if I updated an empty image. In my database the image path of the AJAX-uploaded file of the respected <code>news-id</code> has been succesfully stored and the file is uploaded. How to solve this? Actually I don't mind if the upload method didn't use AJAX but just the ordinary, single form submit method with <code>post</code>, thus omitting the <code>upload</code> ajax button, but according to Kartik documentary, if I want to use the widget that display the previously stored image, it needs Ajax.</p> <p>I had looked around some similar question in StackOverflow etc but all of them had the problem with empty image instance in the Ajax call method ( well, I previously faced the same problem, but i had apply the Formdata on my ajax after I researched), while I don't have the problem with the empty instance on ajax call, but empty instance on the normal form submit.</p> <p>This is my actionUpdate</p> <pre><code>public function actionUpdate($id) { $model = $this-&gt;findModel($id); $image= UploadedFile::getInstanceByName('image'); if ($model-&gt;load(Yii::$app-&gt;request-&gt;post()) &amp;&amp; $model-&gt;save() ){ var_dump($image);exit(); return $this-&gt;redirect(['view', 'id' =&gt; $model-&gt;id]); } else { return $this-&gt;render('update', [ 'model' =&gt; $model, ]); } } </code></pre> <p>Thanks in advance!</p> </div>

未找到kartik \ datecontrol \ DateControl

<div class="post-text" itemprop="text"> <p>I've used <a href="https://github.com/mootensai/yii2-enhanced-gii" rel="nofollow noreferrer">mootensai/yii2-enhanced-gii</a> and they said I should add this code at <code>config\main.php</code>:</p> <pre><code>'modules' =&gt; [ 'gridview' =&gt; [ 'class' =&gt; '\kartik\grid\Module', // see settings on http://demos.krajee.com/grid#module ], 'datecontrol' =&gt; [ 'class' =&gt; '\kartik\datecontrol\Module', // see settings on http://demos.krajee.com/datecontrol#module ], // If you use tree table 'treemanager' =&gt; [ 'class' =&gt; '\kartik\tree\Module', // see settings on http://demos.krajee.com/tree-manager#module ] ], </code></pre> <p>I am using Yii2 Basic so I add it to <code>config/web.php</code> like below </p> <pre><code> 'components' =&gt; [ // some code here ! ], 'modules' =&gt; [ 'gridview' =&gt; [ 'class' =&gt; '\kartik\grid\Module', ], 'datecontrol' =&gt; [ 'class' =&gt; '\kartik\datecontrol\Module', ], 'treemanager' =&gt; [ 'class' =&gt; '\kartik\tree\Module', ] ], </code></pre> <p>So when I run the generated code from Gii it gives me the code for date filed like this: </p> <pre><code>&lt;?= $form-&gt;field($model, 'regester_end_date')-&gt;widget(\kartik\datecontrol\DateControl::classname(), [ 'type' =&gt; \kartik\datecontrol\DateControl::FORMAT_DATE, 'saveFormat' =&gt; 'php:Y-m-d', 'ajaxConversion' =&gt; true, 'options' =&gt; [ 'pluginOptions' =&gt; [ 'placeholder' =&gt; Yii::t('app', 'Choose Regester End Date'), 'autoclose' =&gt; true ] ], ]); ?&gt; </code></pre> <p>When I run my form, it gives me a problem that says <code>Class 'kartik\datecontrol\DateControl' not found</code>. I updated the composer and I install the the kartik widgets and there is nothing happens </p> </div>

Yii2 Kartik TimePicker - 不能在多个模态窗口中使用

<div class="post-text" itemprop="text"> <p>I have a page that launches modal windows that include two TimePicker widgets. When opening the first modal, everything works. It can be reopened as well. However, when opening another modal, I get a console error:</p> <pre><code>Uncaught TypeError: Cannot read property 'apply' of undefined at HTMLInputElement.eval (eval at globalEval (jquery.js:343), &lt;anonymous&gt;:851:29) at Function.each (jquery.js:365) at jQuery.fn.init.each (jquery.js:137) at jQuery.fn.init.$.fn.timepicker (eval at globalEval (jquery.js:343), &lt;anonymous&gt;:841:21) at HTMLDocument.eval (eval at globalEval (jquery.js:343), &lt;anonymous&gt;:3:107) at fire (jquery.js:3187) at Object.add [as done] (jquery.js:3246) at jQuery.fn.init.jQuery.fn.ready (jquery.js:3496) at eval (eval at globalEval (jquery.js:343), &lt;anonymous&gt;:1:18) at eval (&lt;anonymous&gt;) </code></pre> <p>Here is the code causing the error:</p> <pre><code>//TIMEPICKER PLUGIN DEFINITION $.fn.timepicker = function (option) { var args = Array.apply(null, arguments); args.shift(); return this.each(function () { var $this = $(this), data = $this.data('timepicker'), options = typeof option === 'object' &amp;&amp; option; if (!data) { $this.data('timepicker', (data = new Timepicker(this, $.extend({}, $.fn.timepicker.defaults, options, $(this).data())))); } if (typeof option === 'string') { data[option].apply(data, args); // This is the line that causes problems } }); }; </code></pre> <p>Here is the PHP code for one of the widgets:</p> <pre><code>&lt;?= $form-&gt;field($model, 'TimeEntryStartTime',[ 'showLabels'=&gt;false ])-&gt;widget(TimePicker::classname(),[ 'options' =&gt; ['placeholder' =&gt; 'Enter time...'], ]); ?&gt; </code></pre> <p>Here is the javascript that launches the modals (similar for each):</p> <pre><code>// Modal view for Monday $('#modalButtonMonday').click(function(){ // get the click of the create button $('#modalMonday').modal('show') .find('#modalContentMonday') .load($(this).attr('value')); }); $('#modalMonday').on('hidden.bs.modal', function (e) { // reload page when modal closed location.reload(true); }); </code></pre> </div>

如何使用Yii2 kartik-mpdf添加水印

<div class="post-text" itemprop="text"> <p>How can I add watermark image on pdf using kartik-pdf?</p> <p>Here is the line I added:</p> <pre><code>'options' =&gt; [ 'title' =&gt; 'Title', 'showWatermarkText' =&gt; true, 'showWatermarkImage' =&gt; true, ], // call mPDF methods on the fly 'methods' =&gt; [ 'SetHeader' =&gt; ['Title'], 'SetFooter' =&gt; ['{PAGENO}'], 'SetWatermarkText' =&gt; ['DRAFT'], 'SetWatermarkImage' =&gt; $basepath . '/images/imgbox1.jpg', ] </code></pre> <p>Only the text watermark display.</p> <p>Is there something wrong on how I used watermarkImage?</p> </div>

YII2 Kartik - ExportMenu仅使用选中项目导出数据

<div class="post-text" itemprop="text"> <p>I include Kartik yii2 ExportMenu plugin and its working fine for all data export but now I want to export only selected rows which is checked on grid.</p> <pre><code>&lt;?php $gridColumns = [ ['class' =&gt; 'yii\grid\SerialColumn'], 'username', 'email', [ 'label' =&gt; Yii::t('app','User Access'), 'value' =&gt; function($model){ if($model-&gt;access_level == 1) { return 'Read/Write/Import/Export'; } if($model-&gt;access_level == 2) { return 'Read/Write'; } if($model-&gt;access_level == 3) { return 'Read'; } } ], 'fullname', // [ // 'label' =&gt; Yii::t('app','Status'), // 'value' =&gt; function($model){ // if($model-&gt;status == 10) { return 'Active'; } // if($model-&gt;status == 0) { return 'Inactive'; } // } // ], [ 'attribute' =&gt; 'created_at', 'format' =&gt; ['date' , 'php:d/m/Y'], 'label' =&gt; Yii::t('app','Created On'), 'headerOptions' =&gt; ['style' =&gt; 'width:12%;'], ], [ 'attribute' =&gt; 'updated_at', 'format' =&gt; ['date' , 'php:d/m/Y'], 'label' =&gt; Yii::t('app','Modified On'), 'headerOptions' =&gt; ['style' =&gt; 'width:12%;'], ], // 'updated_by', [ 'attribute' =&gt; 'updated_by', 'label' =&gt; Yii::t('app','Modified By'), 'headerOptions' =&gt; ['style' =&gt; 'width:12%;'], 'value' =&gt; 'user.username', // 'value' =&gt; function($model){ // return $model-&gt;user-&gt;username; // } ], // ['class' =&gt; 'yii\grid\ActionColumn'], ]; echo ExportMenu::widget([ 'dataProvider' =&gt; $dataProvider, 'columns' =&gt; $gridColumns, 'target' =&gt; ExportMenu::TARGET_BLANK, 'showConfirmAlert' =&gt; false, 'filename' =&gt; 'Users', 'dropdownOptions' =&gt; [ 'label' =&gt; 'Export', 'class' =&gt; 'btn btn-info', 'export' =&gt; true, 'toolbar'=&gt;[ '{export}', '{toggleData}' ] ], 'exportConfig'=&gt;[ ExportMenu::FORMAT_HTML=&gt;false, ExportMenu::FORMAT_TEXT=&gt;false, ExportMenu::FORMAT_PDF=&gt;false, ExportMenu::FORMAT_EXCEL=&gt;false, ], ]);?&gt; </code></pre> <p>Can anyone please help me to export data which is checked only . If you need any other information related code please ask. Thanks.</p> </div>

Kartik Select2返回null

<div class="post-text" itemprop="text"> <p>i have a problem with Kartik Select2. When I want save multiple data in my controller, nothing is saved. And I remove foreach in controller, Yii return me error with information about $university_id IS NULL. </p> <p>User Form</p> <pre><code>&lt;?= $form-&gt;field($user_university, 'university_id')-&gt;widget(Select2::classname(),[ 'name' =&gt; 'university_id[]', 'data' =&gt; ArrayHelper::map( \app\models\University::find()-&gt;asArray()-&gt;all(), 'id', function ($university) { return $university['name']; } ), 'size' =&gt; Select2::MEDIUM, 'options' =&gt; ['placeholder' =&gt; 'Select a state ...', 'multiple' =&gt; true], 'pluginOptions' =&gt; [ 'allowClear' =&gt; true ], ]); ?&gt; </code></pre> <p>User Controller</p> <pre><code> $user = new User(); $user-&gt;scenario = User::SCENARIO_CREATE; $auth_assignment = new AuthAssignment(); $user_company = new UserCompany(); $user_university = new UserUniversity(); $user_status = UserStatus::find() -&gt;select('id') -&gt;where(['name' =&gt; UserStatus::NON_AUTHORIZED_USER]) -&gt;one(); if ($user-&gt;load(Yii::$app-&gt;request-&gt;post()) &amp;&amp; $auth_assignment-&gt;load(Yii::$app-&gt;request-&gt;post())) { $user-&gt;auth_key = Yii::$app-&gt;getSecurity()-&gt;generateRandomString(); $user-&gt;password_hash = Yii::$app-&gt;getSecurity()-&gt;generatePasswordHash($user-&gt;password); $user-&gt;password_reset_token = Yii::$app-&gt;getSecurity()-&gt;generateRandomString(); $user-&gt;status_id = $user_status-&gt;id; $user-&gt;created_at = date('Y-m-d H:i:s'); $user-&gt;updated_at = date('Y-m-d H:i:s'); if ($user-&gt;save()) { $auth_assignment-&gt;user_id = $user-&gt;id; $auth_assignment-&gt;created_at = date('Y-m-d H:i:s'); $universities = $user_university-&gt;university_id; foreach((array) $universities as $university) { $newUserUniversity = new UserUniversity(); $newUserUniversity-&gt;user_id = $user-&gt;id; $newUserUniversity-&gt;university_id = $university; $newUserUniversity-&gt;created_at = date('Y-m-d H:i:s'); $newUserUniversity-&gt;save(false); }... </code></pre> <p>User University Model Rule</p> <pre><code>public function rules() { return [ [['user_id', 'university_id', 'created_at'], 'required'], [['user_id', 'university_id','confirm'], 'integer'], [['created_at','university_id'], 'safe'], [['university_id'], 'exist', 'skipOnError' =&gt; true, 'targetClass' =&gt; University::className(), 'targetAttribute' =&gt; ['university_id' =&gt; 'id']], [['user_id'], 'exist', 'skipOnError' =&gt; true, 'targetClass' =&gt; User::className(), 'targetAttribute' =&gt; ['user_id' =&gt; 'id']], ]; } </code></pre> </div>

2019 AI开发者大会

2019 AI开发者大会(AI ProCon 2019)是由中国IT社区CSDN主办的AI技术与产业年度盛会。多年经验淬炼,如今蓄势待发:2019年9月6-7日,大会将有近百位中美顶尖AI专家、知名企业代表以及千余名AI开发者齐聚北京,进行技术解读和产业论证。我们不空谈口号,只谈技术,诚挚邀请AI业内人士一起共铸人工智能新篇章!


实验内容: 通过对具体的文件存储空间的管理、文件的物理结构、目录结构和文件操作的实现,加深对文件系统内部功能和实现过程的理解。 要求: 1.在内存中开辟一个虚拟磁盘空间作为文件存储器,在其上实现一个简



2019数学建模A题高压油管的压力控制 省一论文即代码




Git 实用技巧

这几年越来越多的开发团队使用了Git,掌握Git的使用已经越来越重要,已经是一个开发者必备的一项技能;但很多人在刚开始学习Git的时候会遇到很多疑问,比如之前使用过SVN的开发者想不通Git提交代码为什么需要先commit然后再去push,而不是一条命令一次性搞定; 更多的开发者对Git已经入门,不过在遇到一些代码冲突、需要恢复Git代码时候就不知所措,这个时候哪些对 Git掌握得比较好的少数人,就像团队中的神一样,在队友遇到 Git 相关的问题的时候用各种流利的操作来帮助队友于水火。 我去年刚加入新团队,发现一些同事对Git的常规操作没太大问题,但对Git的理解还是比较生疏,比如说分支和分支之间的关联关系、合并代码时候的冲突解决、提交代码前未拉取新代码导致冲突问题的处理等,我在协助处理这些问题的时候也记录各种问题的解决办法,希望整理后通过教程帮助到更多对Git操作进阶的开发者。 本期教程学习方法分为“掌握基础——稳步进阶——熟悉协作”三个层次。从掌握基础的 Git的推送和拉取开始,以案例进行演示,分析每一个步骤的操作方式和原理,从理解Git 工具的操作到学会代码存储结构、演示不同场景下Git遇到问题的不同处理方案。循序渐进让同学们掌握Git工具在团队协作中的整体协作流程。 在教程中会通过大量案例进行分析,案例会模拟在工作中遇到的问题,从最基础的代码提交和拉取、代码冲突解决、代码仓库的数据维护、Git服务端搭建等。为了让同学们容易理解,对Git简单易懂,文章中详细记录了详细的操作步骤,提供大量演示截图和解析。在教程的最后部分,会从提升团队整体效率的角度对Git工具进行讲解,包括规范操作、Gitlab的搭建、钩子事件的应用等。 为了让同学们可以利用碎片化时间来灵活学习,在教程文章中大程度降低了上下文的依赖,让大家可以在工作之余进行学习与实战,并同时掌握里面涉及的Git不常见操作的相关知识,理解Git工具在工作遇到的问题解决思路和方法,相信一定会对大家的前端技能进阶大有帮助。


原价169,限时立减100元! 系统掌握Python核心语法16点,轻松应对工作中80%以上的Python使用场景! 69元=72讲+源码+社群答疑+讲师社群分享会&nbsp; 【哪些人适合学习这门课程?】 1)大学生,平时只学习了Python理论,并未接触Python实战问题; 2)对Python实用技能掌握薄弱的人,自动化、爬虫、数据分析能让你快速提高工作效率; 3)想学习新技术,如:人工智能、机器学习、深度学习等,这门课程是你的必修课程; 4)想修炼更好的编程内功,优秀的工程师肯定不能只会一门语言,Python语言功能强大、使用高效、简单易学。 【超实用技能】 从零开始 自动生成工作周报 职场升级 豆瓣电影数据爬取 实用案例 奥运冠军数据分析 自动化办公:通过Python自动化分析Excel数据并自动操作Word文档,最终获得一份基于Excel表格的数据分析报告。 豆瓣电影爬虫:通过Python自动爬取豆瓣电影信息并将电影图片保存到本地。 奥运会数据分析实战 简介:通过Python分析120年间奥运会的数据,从不同角度入手分析,从而得出一些有趣的结论。 【超人气老师】 二两 中国人工智能协会高级会员 生成对抗神经网络研究者 《深入浅出生成对抗网络:原理剖析与TensorFlow实现》一书作者 阿里云大学云学院导师 前大型游戏公司后端工程师 【超丰富实用案例】 0)图片背景去除案例 1)自动生成工作周报案例 2)豆瓣电影数据爬取案例 3)奥运会数据分析案例 4)自动处理邮件案例 5)github信息爬取/更新提醒案例 6)B站百大UP信息爬取与分析案例 7)构建自己的论文网站案例


深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)


一 专题从基础的C语言核心到c++ 和stl完成基础强化; 二 再到数据结构,设计模式完成专业计算机技能强化; 三 通过跨平台网络编程,linux编程,qt界面编程,mfc编程,windows编程,c++与lua联合编程来完成应用强化 四 最后通过基于ffmpeg的音视频播放器,直播推流,屏幕录像,




文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...



Vue.js 2.0之全家桶系列视频课程

基于新的Vue.js 2.3版本, 目前新全的Vue.js教学视频,让你少走弯路,直达技术前沿! 1. 包含Vue.js全家桶(vue.js、vue-router、axios、vuex、vue-cli、webpack、ElementUI等) 2. 采用笔记+代码案例的形式讲解,通俗易懂




第三十一问: 说一下线程中sleep()和wait()区别? 1 . sleep()是让正在执行的线程主动让出CPU,当时间到了,在回到自己的线程让程序运行。但是它并没有释放同步资源锁只是让出。 2.wait()是让当前线程暂时退让出同步资源锁,让其他线程来获取到这个同步资源在调用notify()方法,才会让其解除wait状态,再次参与抢资源。 3. sleep()方法可以在任何地方使用,而wait()只能在同步方法或同步块使用。 ...

java jdk 8 帮助文档 中文 文档 chm 谷歌翻译

JDK1.8 API 中文谷歌翻译版 java帮助文档 JDK API java 帮助文档 谷歌翻译 JDK1.8 API 中文 谷歌翻译版 java帮助文档 Java最新帮助文档 本帮助文档是使用谷





Visual Assist X 破解补丁

vs a's'sixt插件 支持vs2008-vs2019 亲测可以破解,希望可以帮助到大家


【为什么学爬虫?】 &nbsp; &nbsp; &nbsp; &nbsp;1、爬虫入手容易,但是深入较难,如何写出高效率的爬虫,如何写出灵活性高可扩展的爬虫都是一项技术活。另外在爬虫过程中,经常容易遇到被反爬虫,比如字体反爬、IP识别、验证码等,如何层层攻克难点拿到想要的数据,这门课程,你都能学到! &nbsp; &nbsp; &nbsp; &nbsp;2、如果是作为一个其他行业的开发者,比如app开发,web开发,学习爬虫能让你加强对技术的认知,能够开发出更加安全的软件和网站 【课程设计】 一个完整的爬虫程序,无论大小,总体来说可以分成三个步骤,分别是: 网络请求:模拟浏览器的行为从网上抓取数据。 数据解析:将请求下来的数据进行过滤,提取我们想要的数据。 数据存储:将提取到的数据存储到硬盘或者内存中。比如用mysql数据库或者redis等。 那么本课程也是按照这几个步骤循序渐进的进行讲解,带领学生完整的掌握每个步骤的技术。另外,因为爬虫的多样性,在爬取的过程中可能会发生被反爬、效率低下等。因此我们又增加了两个章节用来提高爬虫程序的灵活性,分别是: 爬虫进阶:包括IP代理,多线程爬虫,图形验证码识别、JS加密解密、动态网页爬虫、字体反爬识别等。 Scrapy和分布式爬虫:Scrapy框架、Scrapy-redis组件、分布式爬虫等。 通过爬虫进阶的知识点我们能应付大量的反爬网站,而Scrapy框架作为一个专业的爬虫框架,使用他可以快速提高我们编写爬虫程序的效率和速度。另外如果一台机器不能满足你的需求,我们可以用分布式爬虫让多台机器帮助你快速爬取数据。 &nbsp; 从基础爬虫到商业化应用爬虫,本套课程满足您的所有需求! 【课程服务】 专属付费社群+每周三讨论会+1v1答疑


功能描述:包括用户的登录注册,以及个人资料的修改.商品的分类展示,详情,加入购物车,生成订单,到银行支付等!另外还有收货地址的和我的收藏等常用操作.环境(JDK 1.7 ,mysql 5.5,Ecli


&nbsp; &nbsp; &nbsp; &nbsp; 本课程为Python数据挖掘方向的入门课程,课程主要以真实数据为基础,详细介绍数据挖掘入门的流程和使用Python实现pandas与numpy在数据挖掘方向的运用,并深入学习如何运用scikit-learn调用常用的数据挖掘算法解决数据挖掘问题,为进一步深入学习数据挖掘打下扎实的基础。


图像处理和计算机视觉的课程大家已经看过很多,但总有“听不透”,“用不了”的感觉。课程致力于创建人人都能听的懂的计算机视觉,通过生动、细腻的讲解配合实战演练,让学生真正学懂、用会。 【超实用课程内容】 课程内容分为三篇,包括视觉系统构成,图像处理基础,特征提取与描述,运动跟踪,位姿估计,三维重构等内容。课程理论与实战结合,注重教学内容的可视化和工程实践,为人工智能视觉研发及算法工程师等相关高薪职位就业打下坚实基础。 【课程如何观看?】 PC端:https://edu.csdn.net/course/detail/26281 移动端:CSDN 学院APP(注意不是CSDN APP哦) 本课程为录播课,课程2年有效观看时长,但是大家可以抓紧时间学习后一起讨论哦~ 【学员专享增值服务】 源码开放 课件、课程案例代码完全开放给你,你可以根据所学知识,自行修改、优化 下载方式:电脑登录https://edu.csdn.net/course/detail/26281,点击右下方课程资料、代码、课件等打包下载


本课程内容系统、全面、简洁、通俗易懂,通过2个多小时的介绍,让大家对软件测试有个系统的理解和认识,具备基本的软件测试理论基础。 主要内容分为5个部分: 1 软件测试概述,了解测试是什么、测试的对象、原则、流程、方法、模型;&nbsp; 2.常用的黑盒测试用例设计方法及示例演示;&nbsp; 3 常用白盒测试用例设计方法及示例演示;&nbsp; 4.自动化测试优缺点、使用范围及示例‘;&nbsp; 5.测试经验谈。


课程主要面向嵌入式Linux初学者、工程师、学生 主要从一下几方面进行讲解: 1.linux学习路线、基本命令、高级命令 2.shell、vi及vim入门讲解 3.软件安装下载、NFS、Samba、FTP等服务器配置及使用

2019 Python开发者日-培训


快速入门Android开发 视频 教程 android studio

这是一门快速入门Android开发课程,顾名思义是让大家能快速入门Android开发。 学完能让你学会如下知识点: Android的发展历程 搭建Java开发环境 搭建Android开发环境 Android Studio基础使用方法 Android Studio创建项目 项目运行到模拟器 项目运行到真实手机 Android中常用控件 排查开发中的错误 Android中请求网络 常用Android开发命令 快速入门Gradle构建系统 项目实战:看美图 常用Android Studio使用技巧 项目签名打包 如何上架市场




这是一个门针对零基础学员学习微信小程序开发的视频教学课程。课程采用腾讯官方文档作为教程的唯一技术资料来源。杜绝网络上质量良莠不齐的资料给学员学习带来的障碍。 视频课程按照开发工具的下载、安装、使用、程序结构、视图层、逻辑层、微信小程序等几个部分组织课程,详细讲解整个小程序的开发过程

相关热词 c#框体中的退出函数 c# 按钮透明背景 c# idl 混编出错 c#在位置0处没有任何行 c# 循环给数组插入数据 c# 多线程死锁的例子 c# 钉钉读取员工排班 c# label 不显示 c#裁剪影像 c#工作进程更新ui