CakePhp使用Ajax加载highcharts div内容

时间:2016-11-21 15:15:31

标签: html ajax cakephp reload

我有一个选择字段我希望当我选择一个选项时,我使用以下ajax函数重新加载我的div图表内容:

function function_get_date_graphe(graphe_date){ 
       var date = graphe_date;

       $.ajax({
            type: "post",
            url: base_url + "/icicpermis/trainers/graph2/"+date,
            data: 'graphe_date='+date, 
            success: function(response) { 
                document.getElementById('piewrapper').innerHTML=response ;

            }

        });
    }

那是我要重新加载的div

<div id="piewrapper" style="display: block; float: left; width:90%; margin-bottom: 20px;">

    <?php //echo $chart->render('Pie Chart'); ?>
    <?php echo $this->Highcharts->render('Pie Chart'); ?>
    </div> 

让你知道我正在使用两个功能控制器第一个&#34; manager_graph&#34;用来显示带有默认内容的defalu图表和seconde one&#34; graph2&#34;由ajax函数调用以获取新内容。问题是当我调用我的ajax函数时,不会显示div。

0 个答案:

没有答案