title: fabric js : change image url in case of grouped objects
body: <p>see link :<a href="http://jsfiddle.net/mishragaurav31/ang58fcL/#base" rel="nofollow">http://jsfiddle.net/mishragaurav31/ang58fcL/#base</a></p>
  
  <p>i make two grouped objects one from two objects (circle and text) and other from two images,</p>
  
  <p>when i want to change attributes of any of group for group 1 it works fine.</p>
  
  <p>but when i want to chnage image src for group 2 it not works.</p>
  
  <p>how to make it works ?..</p>
  
  <p>Html code:</p>
  
  <pre><code>    &lt;canvas id="c" width="400" height="400"&gt;&lt;/canvas&gt;&lt;br&gt;
  &lt;a id="cg1"&gt;change image&lt;/a&gt;
  &lt;a id="cg2"&gt;change text&lt;/a&gt;
  </code></pre>
  
  <p>javascipt code:</p>
  
  <pre><code>var canvas = new fabric.Canvas('c');
  
      fabric.Image.fromURL('http://icons.iconarchive.com/icons/benjigarner/softdimension/256/Image-ready-CS-2-icon.png', function(img) {
          var img1 = img.set({ left: 0, top: 0 });
          fabric.Image.fromURL('http://demo-stable-ofbiz.apache.org/images/products/GZ-1000/small.png', function(img) {
              var img2 = img.set({ left: 0, top: 0 });
              var group = new fabric.Group([ img1, img2], { left: 0, top: 0 });
              canvas.add(group)
          });
      });
  
  
  var comicSansText = new fabric.Text("I'm in Comic Sans", {
    fontFamily: 'Comic Sans'
  });
  
  var circle = new fabric.Circle({
    radius: 100,
    fill: '#942f99',
    scaleY: 0.5,
    originX: 'center',
    originY: 'center'
  });
  
  var group2 = new fabric.Group([ comicSansText, circle ], {
    left: 150,
    top: 100,
    angle: -10
  });
  
  canvas.add(group2);
  
  
  
    document.getElementById('cg1').onclick = function() {
        group.item(1).setAttribute("src", "http://upload.wikimedia.org/wikipedia/en/0/0c/IrfanView_Logo.png");
        canvas.renderAll();
    };
  
    document.getElementById('cg2').onclick = function() {
        group2.item(1).setFill('red');
        canvas.renderAll();
    };
  </code></pre>