Skip to main content
deleted 131 characters in body
Source Link
Paramone
  • 2.7k
  • 4
  • 36
  • 60

I'm working with Yii 2, and it's gridviewgrid view to show information.

Now, my problem is that whenever a user scans two identical serial numbers and/or mac addresses, it should highlight the row (change color to red), and show some error sign or whatever.

Screenshot: Current Grid View

What I want it to look like:

Desired Grid Highlighting

I'm new to Yii2 and don't exactly know how they do it with the gridviewgrid view. I've been researching on this specific problem but couldn't find anything.

Code for Gridview (Nothing special)

 <?= GridView::widget([ 'id' => 'scan-batch-grid', 'dataProvider' => $dataProvider, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], ['class' => 'yii\grid\CheckboxColumn'], [ 'attribute' => 'product_ID', 'value' => 'product.name' ], 'SN', 'MAC', [ 'class' => 'yii\grid\ActionColumn', 'urlCreator' => function ($action, $model, $key, $index) { return Url::to(['scan-batch/view', 'id' => $key, 'scan' => $model->scan_batch_ID]); }, 'buttons' => [ 'update' => function ($url, $model, $key) { return ''; }, 'delete' => function ($url, $model, $key) { return ''; }, ], ], ], ]); ?> 

Could anyone help me? A link or even a slightly relevant Q/A would be appreciated!

EDIT

I only want to know how to change the color of only one row, I can do the checks myself! :).

I'm working with Yii 2, and it's gridview to show information.

Now, my problem is that whenever a user scans two identical serial numbers and/or mac addresses, it should highlight the row (change color to red), and show some error sign or whatever.

Screenshot: Current Grid View

What I want it to look like:

Desired Grid Highlighting

I'm new to Yii2 and don't exactly know how they do it with the gridview. I've been researching on this specific problem but couldn't find anything.

Code for Gridview (Nothing special)

 <?= GridView::widget([ 'id' => 'scan-batch-grid', 'dataProvider' => $dataProvider, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], ['class' => 'yii\grid\CheckboxColumn'], [ 'attribute' => 'product_ID', 'value' => 'product.name' ], 'SN', 'MAC', [ 'class' => 'yii\grid\ActionColumn', 'urlCreator' => function ($action, $model, $key, $index) { return Url::to(['scan-batch/view', 'id' => $key, 'scan' => $model->scan_batch_ID]); }, 'buttons' => [ 'update' => function ($url, $model, $key) { return ''; }, 'delete' => function ($url, $model, $key) { return ''; }, ], ], ], ]); ?> 

Could anyone help me? A link or even a slightly relevant Q/A would be appreciated!

EDIT

I only want to know how to change the color of only one row, I can do the checks myself! :)

I'm working with Yii 2, and it's grid view to show information.

Now, my problem is that whenever a user scans two identical serial numbers and/or mac addresses, it should highlight the row (change color to red), and show some error sign or whatever.

Screenshot: Current Grid View

What I want it to look like:

Desired Grid Highlighting

I'm new to Yii2 and don't exactly know how they do it with the grid view. I've been researching on this specific problem but couldn't find anything.

Code for Gridview

 <?= GridView::widget([ 'id' => 'scan-batch-grid', 'dataProvider' => $dataProvider, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], ['class' => 'yii\grid\CheckboxColumn'], [ 'attribute' => 'product_ID', 'value' => 'product.name' ], 'SN', 'MAC', [ 'class' => 'yii\grid\ActionColumn', 'urlCreator' => function ($action, $model, $key, $index) { return Url::to(['scan-batch/view', 'id' => $key, 'scan' => $model->scan_batch_ID]); }, 'buttons' => [ 'update' => function ($url, $model, $key) { return ''; }, 'delete' => function ($url, $model, $key) { return ''; }, ], ], ], ]); ?> 

EDIT

I only want to know how to change the color of only one row.

I'm working with Yii 2, and it's gridview to show information.

Now, my problem is that whenever a user scans two identical serial numbers and/or mac addresses, it should highlight the row (change color to red), and show some error sign or whatever.

Screenshot: enter image description hereCurrent Grid View

What I want it to look like:

enter image description hereDesired Grid Highlighting

I'm new to Yii2 and don't exactly know how they do it with the gridview. I've been researching on this specific problem but couldn't find anything.

Code for Gridview (Nothing special)

 <?= GridView::widget([ 'id' => 'scan-batch-grid', 'dataProvider' => $dataProvider, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], ['class' => 'yii\grid\CheckboxColumn'], [ 'attribute' => 'product_ID', 'value' => 'product.name' ], 'SN', 'MAC', [ 'class' => 'yii\grid\ActionColumn', 'urlCreator' => function ($action, $model, $key, $index) { return Url::to(['scan-batch/view', 'id' => $key, 'scan' => $model->scan_batch_ID]); }, 'buttons' => [ 'update' => function ($url, $model, $key) { return ''; }, 'delete' => function ($url, $model, $key) { return ''; }, ], ], ], ]); ?> 

Could anyone help me? A link or even a slightly relevant Q/A would be appriciatedappreciated!

EDIT

I only want to know how to change the color of only one row, I can do the checks myself! :)

I'm working with Yii 2, and it's gridview to show information.

Now, my problem is that whenever a user scans two identical serial numbers and/or mac addresses, it should highlight the row (change color to red), and show some error sign or whatever.

Screenshot: enter image description here

What I want it to look like:

enter image description here

I'm new to Yii2 and don't exactly know how they do it with the gridview. I've been researching on this specific problem but couldn't find anything.

Code for Gridview (Nothing special)

 <?= GridView::widget([ 'id' => 'scan-batch-grid', 'dataProvider' => $dataProvider, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], ['class' => 'yii\grid\CheckboxColumn'], [ 'attribute' => 'product_ID', 'value' => 'product.name' ], 'SN', 'MAC', [ 'class' => 'yii\grid\ActionColumn', 'urlCreator' => function ($action, $model, $key, $index) { return Url::to(['scan-batch/view', 'id' => $key, 'scan' => $model->scan_batch_ID]); }, 'buttons' => [ 'update' => function ($url, $model, $key) { return ''; }, 'delete' => function ($url, $model, $key) { return ''; }, ], ], ], ]); ?> 

Could anyone help me? A link or even a slightly relevant Q/A would be appriciated!

EDIT

I only want to know how to change the color of only one row, I can do the checks myself! :)

I'm working with Yii 2, and it's gridview to show information.

Now, my problem is that whenever a user scans two identical serial numbers and/or mac addresses, it should highlight the row (change color to red), and show some error sign or whatever.

Screenshot: Current Grid View

What I want it to look like:

Desired Grid Highlighting

I'm new to Yii2 and don't exactly know how they do it with the gridview. I've been researching on this specific problem but couldn't find anything.

Code for Gridview (Nothing special)

 <?= GridView::widget([ 'id' => 'scan-batch-grid', 'dataProvider' => $dataProvider, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], ['class' => 'yii\grid\CheckboxColumn'], [ 'attribute' => 'product_ID', 'value' => 'product.name' ], 'SN', 'MAC', [ 'class' => 'yii\grid\ActionColumn', 'urlCreator' => function ($action, $model, $key, $index) { return Url::to(['scan-batch/view', 'id' => $key, 'scan' => $model->scan_batch_ID]); }, 'buttons' => [ 'update' => function ($url, $model, $key) { return ''; }, 'delete' => function ($url, $model, $key) { return ''; }, ], ], ], ]); ?> 

Could anyone help me? A link or even a slightly relevant Q/A would be appreciated!

EDIT

I only want to know how to change the color of only one row, I can do the checks myself! :)

Wrong tag Yii -> Yii2
Link
Paramone
  • 2.7k
  • 4
  • 36
  • 60
added 107 characters in body
Source Link
Paramone
  • 2.7k
  • 4
  • 36
  • 60
Loading
Source Link
Paramone
  • 2.7k
  • 4
  • 36
  • 60
Loading