1

初めて有効なデータで次を呼び出すと...すべてがうまくいき、テーブルは見栄えがします:

        <script language = "javascript">  
            scheduler.clearAll();

            scheduler.createTimelineView({ 
                section_autoheight: false, 
                name: "timeline", 
                x_unit: "day", 
                x_date: "%d", 
                x_step: 1, 
                x_size: 30, 
                x_start: 1, 
                y_unit: <?php echo json_encode($json); ?>, 
                y_property: "section_id", 
                render: "tree", 
                fit_events: true, 
                dy: 30, 
                //dx: 150, 
                second_scale:{
                x_unit: "day", 
                x_date: "%M" 
                } 
            });      

            scheduler.config.lightbox.sections = [  
                {name:"description", height:130, map_to:"text", type:"textarea" , focus:true},
                {name:"custom", height:23, type:"timeline", options:null , map_to:"section_id" }, //type should be the same as name of the tab
                {name:"time", height:72, type:"time", map_to:"auto"}
            ];

            scheduler.init('scheduler_here',new Date(<?php echo date("Y"); ?>, <?php echo date("n") - 1; ?>, <?php echo date("j"); ?>),"timeline");

            scheduler.parse(<?php echo json_encode($scheduler); ?>, "json");
        </script>  

しかし、同じブロックを再度呼び出すと、x 軸の見出しの高さが 2 倍になります。もう一度呼び出すと、最後の倍数が2倍になります..

私が何を間違えたのか分かりますか?

4

4 に答える 4

1

scheduler.createTimelineView 内にプロパティ「section_autoheight : false」を追加するだけです。これで問題は解決します。

于 2014-05-13T08:52:50.333 に答える
1

それでも誰かの役に立つなら

「スケジューラ」はグローバル オブジェクトであるため、このブロックを数回呼び出すと、タイムライン ビューが上書きされ、そのたびにスケジューラが再初期化されます。これは望ましいアプローチではありません。あなたの場合、奇妙な副作用の理由になるはずです。

イベント、タイムラインのセクション、およびアクティブな日付の変更をリロードするためにこのスクリプトが必要な場合は、次の操作を実行できます。

  1. 変更されていない構成をページの静的部分に配置する
  2. 「 scheduler.serverList」メソッドでタイムラインのセクションを指定します
  3. リロードされたコードでは、' scheduler.updateCollection ' でタイムラインのセクションを更新し、イベントを解析し、' scheduler.setCurrentView ' でアクティブな日付を変更するだけです。

静的コード:

scheduler.createTimelineView({
    section_autoheight: false,
    name: "timeline",
    x_unit: "day",
    x_date: "%d",
    x_step: 1,
    x_size: 30,
    x_start: 1,
    y_unit: scheduler.serverList("timeline", []),
    y_property: "section_id",
    render: "tree",
    fit_events: true,
    dy: 30,
    //dx: 150,
    second_scale:{
        x_unit: "day",
        x_date: "%M"
    }
});
scheduler.config.lightbox.sections = [
    {name:"description", height:130, map_to:"text", type:"textarea" , focus:true},
    {name:"custom", height:23, type:"timeline", options:null , map_to:"section_id" }, //type should be the same as name of the tab
    {name:"time", height:72, type:"time", map_to:"auto"}
];

scheduler.init('scheduler_here',new Date(),"timeline");

リロードされたコード

<script language = "javascript">
    scheduler.clearAll();
    scheduler.updateCollection("timeline", <?php echo json_encode($json); ?>);
    scheduler.parse(<?php echo json_encode($scheduler); ?>, "json");
    scheduler.setCurrentView(new Date(<?php echo date("Y"); ?>, <?php echo date("n") - 1; ?>, <?php echo date("j"); ?>));

</script>

関連ドキュメント:

http://docs.dhtmlx.com/scheduler/api__scheduler_serverlist.html http://docs.dhtmlx.com/scheduler/api__scheduler_updatecollection.html http://docs.dhtmlx.com/scheduler/api__scheduler_setcurrentview.html

于 2014-01-21T10:55:40.447 に答える
1
scheduler.xy.scale_height = 30;

このコード行を追加しました。奇妙な高さの問題を上書きします。わーい

于 2012-08-30T14:41:23.023 に答える
0

それ以外の場合は、dhtmlx モバイル スケジューラの幅と高さを以下のように指定できます。

dhx.ui ({ ビュー:"ウィンドウ", 高さ:300, 幅:300, ...
})

リンク:: http://docs.dhtmlx.com/touch/doku.php?id=api:module_baseview よろしく、ユバラジ

于 2014-01-10T04:51:22.533 に答える