Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F12'ing in Edge Browser reveals Dateline jquery is loaded but not showing #1

Open
rossaddison opened this issue May 19, 2020 · 0 comments

Comments

@rossaddison
Copy link

rossaddison commented May 19, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant