kartik-v

How to pass node id for each node clicked in kartik treeview?

社会主义新天地 提交于 2020-07-03 13:08:54
问题 I have multiple nodes. I want to show different views on each node click. For this, I have to pass the node id. Below is my code in which I have tried to explain the total scenario `<?= TreeView::widget([ 'query' => \common\models\MdcNode::find()->addOrderBy('root, lft'), 'headingOptions' => ['label' => 'Root'], 'rootOptions' => ['label'=>'<span class="text-primary">Root</span>'], 'topRootAsHeading' => true, // this will override the headingOptions //'displayValue' => 1, // initial display

How to pass node id for each node clicked in kartik treeview?

折月煮酒 提交于 2020-07-03 13:05:16
问题 I have multiple nodes. I want to show different views on each node click. For this, I have to pass the node id. Below is my code in which I have tried to explain the total scenario `<?= TreeView::widget([ 'query' => \common\models\MdcNode::find()->addOrderBy('root, lft'), 'headingOptions' => ['label' => 'Root'], 'rootOptions' => ['label'=>'<span class="text-primary">Root</span>'], 'topRootAsHeading' => true, // this will override the headingOptions //'displayValue' => 1, // initial display

Yii2 Show/Hide kartik treeview nodes

女生的网名这么多〃 提交于 2020-07-01 06:09:27
问题 I am using Kartik Tree Manager. I am able to add, remove, update nodes. There is more requirement, that is to show/hide nodes on the basis of user access. i.e. when a user is given a specific node(s) then only that particular node(s) with all the child (if any) should be shown. What I have done so far? I have created a table user-node in which I am assigning a node id to a user as shown below What I want to do Now I want to show only the specified node with its child node only and hide other

kartik tree view show different views on each node click

非 Y 不嫁゛ 提交于 2020-06-27 11:21:54
问题 I am working on Yii2 . I have created a tree using kartik tree manager. By default on each node click it shows me ID , name etc. But I want to show other data. Below is my code <?= TreeView::widget([ 'query' => \common\models\MdcNode::find()->addOrderBy('root, lft'), 'headingOptions' => ['label' => 'Root'], 'rootOptions' => ['label'=>'<span class="text-primary">Root</span>'], 'topRootAsHeading' => true, // this will override the headingOptions 'fontAwesome' => true, 'isAdmin' => false, //

Yii2: Get selected rows data from gridView checkbox columns into controller

痴心易碎 提交于 2020-01-01 09:42:18
问题 I've view page( index.php ) in my Yii2 project, and I'm using Kartik gridView for showing the data This the view from index.php: On the right side of view, I've a checkbox column. And I've an Export button. I want to export the selected name (selected by checkbox) into name.txt file. I've finally make the export function, but I don't know how to get the selected data from view into controller. I've try suggestions that I got from many forums, for example: I put this javascript code in my view

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

扶醉桌前 提交于 2019-12-13 12:41:40
问题 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

Yii2: Kartik Select2: Initial Value from Model Attribute

随声附和 提交于 2019-12-13 07:25:12
问题 I have a Model who has a column (attribute) that stored a comma separated value of IDs. For Example, Movie has a column "Genre" that includes more than one genre, e.g.: 40,20,1,3 How can I use Select2 widget to show these values separated when 'multiple' => true And how can I save them back into comma-separated value as a string. I want a solution that will allow for quick flexibility. I know you can implode and explode the string but seems too much. Any help appreciated 回答1: If I remember

Yii2 ActiveForm validation error on Kartik's FileInput widget

不问归期 提交于 2019-12-13 03:49:15
问题 I have an ActiveForm with Kartik's FileInput widget. It is a type of Edit Form. I am fetching db data in it along with images. Case 1 - If Image is already added, it is showing large-image field as required whenever I click on update button. Case 2 - If I Choose new image, it is working fine. How can I set some value for FileInput for existing images to make it not empty/valid. I want some solution for case1. Each time its asking for new image to update any changes. Please help me to fix this

Yii2 - Export Kartik-v

二次信任 提交于 2019-12-12 03:58:20
问题 I have many tables that can be displayed in Yii2. One of them is like this: We can download the table by clicking download button. Many tables can be download one by one. One table can only download its table. Actually, I want all of tables can be downloaded in one file. What I want to ask: Is there any way to download all of the tables and make them on one document? Here is my view code: <?php use yii\helpers\Html; use kartik\grid\GridView; use yii\widgets\Pjax; use yii\bootstrap\Model; use

How to disable /override dependencies in Yii2

喜夏-厌秋 提交于 2019-12-11 15:30:14
问题 Problem : The 'kartik-v\yii2-dialog' which is used by 'kartik-v\tree-manager' overrides Sweetalert dialog/message box. How does one disable the treeview-manager's dependency 'kartik-v\yii2-dialog' in order to use SweetAlerts? Tried : 'assetManager' => ['bundles' => [ 'kartik\dialog\DialogAsset' => ['js' => [],], ... , Sweetalert starts working in grids and confirm events, but then treemanager no longer works (Uncaught ReferenceError: KrajeeDialog is not defined) In Pictures: Have: Want: Any