You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Sjaak,
Just testing your widget. Integrating it in rossaddison/yii2-house2house which is opensourced now and using sjaakp/pluto .
I am pulling data in from dataProvider:
Historyline/index.php
<?php
use yii\helpers\Html;
use sjaakp\dateline\Dateline;
use yii\widgets\ListView;
$this->title = Yii::t('app','Historylines');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="historyline-index">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Create Historyline', ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?=
ListView::widget([
'dataProvider' => $dataProvider,
'itemOptions' => ['class' => 'item'],
'itemView' => function ($model, $key, $index, $widget) {
return Html::a(Html::encode($model->start) . Html::encode($model->text), ['view', 'id' =>
$model->id]);
},
]);
?>
</div>
<?php
Dateline::begin([
'dataProvider' => $dataProvider,
'attributes' => [
//id is used to create a url to go to on clicking on the event. Refer to options url
'id'=> function($model){return "$model->controller_name/$model->controller_action/$model->controller_action_id";},
'start' => function($model){return $model->start;},
'stop' => function($model){return $model->stop;},
'post_start' => function($model){return $model->post_start;},
'pre_stop' => function($model){return $model->pre_stop;},
'class'=>function($model){return $model->class;},
'text'=>function($model){return $model->text;},
],
'htmlOptions'=> ['id'=>'w84','style'=>'<font-size: 12px; height: 320px;', 'class'=>'d-dateline col-red col2-red', 'tabindex'=>0],
'options' => [
//one year before today's date
'begin' => date('Y-m-d', strtotime(date('Y-m-d'). ' - 1000 days')),
//end one year from today's date
'end' => date('Y-m-d', strtotime(date('Y-m-d'). ' + 1000 days')),
//center timeline on today's date
'cursor' => date('Y-m-d'),
'size' => '500px',
//redirects to historyline controller. Insert your redirects there
'url'=>'/',
'redirect'=>false,
],
]);
$dl->band([
'size' => '80%',
//'layout'=>'overview',
'scale' => Dateline::MONTH,
'interval'=> 1000,
])->band([
'size' => '10%',
'layout' => 'overview',
'scale' => Dateline::YEAR,
'interval'=> 100
])->end();
?>
Do you have some pointers perhaps and things to watch out for? *Ok! I have solved it. In the bands it should not be width but size. My mistake. Works really well. Thanks.
I have also increased the interval on Months so that I can fill more events in. At the moment I would like the cleaning runs to be color-coded so going to insert colors.
The text was updated successfully, but these errors were encountered:
Hi Sjaak,
Just testing your widget. Integrating it in rossaddison/yii2-house2house which is opensourced now and using sjaakp/pluto .
I am pulling data in from dataProvider:
Historyline/index.php
?>
Do you have some pointers perhaps and things to watch out for? *Ok! I have solved it. In the bands it should not be width but size. My mistake. Works really well. Thanks.
I have also increased the interval on Months so that I can fill more events in. At the moment I would like the cleaning runs to be color-coded so going to insert colors.
The text was updated successfully, but these errors were encountered: