0
<div id="divId_graph" ></div>
<div class="graph" id="graph" style="margin-top:-15px"></div>

controller.js:

$('#graph').svg({ onLoad:drawIntro});

The drawIntro is a function which calculate values.It's not calling when I recall the function with in same page by change some input values.

4
  • can you post the full codes? Commented Jan 22, 2016 at 5:44
  • It's generally recommended to wrap DOM manipulation, like jQuery SVG, in a directive. You can then bind the input values as attributes of the directive then $watch for changes and redraw when a change is detected. Alternatively you could use an event listener and emit/broadcast the appropriate event to trigger a redraw. Commented Jan 22, 2016 at 7:17
  • 1
    well,i came to know that we can do that by maintaining a separate page with the code where we want to reload and then call that page using ajax which passes values to that div Commented Feb 3, 2016 at 8:13

1 Answer 1

0
$.ajax({

            type: "GET",

            url: "/templates/ch_div_content.html?loadPortion=graph",

            data: "partnerSelect="+$rootScope.partnerSelect,

            success: function(msg){

                if (box1) box1.remove();

                $("#divId_graph").html(msg);

            }

        });



the the ch-div-content.html is the part i want to reload and it is as  follows
<?php if ($loadPortion == 'graph'){ ?>                           

<script language="javascript">
if($( ".graph" )[1]!==undefined){
     $( ".graph" )[1].remove();
 }
</script>

 <div class="graph" id="graph" style="margin-top:25px">


</div>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.