2 Replies Latest reply on Jul 17, 2008 9:27 AM by ntsiii

    Set viewstack SelectedIndex and datagrid SelectedIndex with one click.

    jose_luis
      Hi,
      please help me. I have a viewstack with 4 canvas (pages). The first is like a index, with images with "click" action that must to do this:
      1. set the viewstack selectedIndex to 1, 2 or 3
      2. set the selectedIndex of a datagrid that are in the canvas 2, 3 or 4 of the viewstack.

      I've tried with:
      <mx:Image x="415" y="26" source="assets/imgs/inicio/dno_01.jpg" click="pages.selectedIndex=2; datagrid1.selectedIndex=2;"/>

      and with

      :<mx:Script>
      <![CDATA[
      private function circ_01():void{
      pages.selectedIndex=1;
      gridProyectos.selectedIndex=5;
      }
      ]]>
      </mx:Script>
      <mx:Image x="331" y="26" source="assets/imgs/inicio/arq_01.jpg" height="69" width="69" click="circ_01();"/>

      but the first time that I make click only set the viewstack page/canvas but not the index on the datagrid. BUT the second time that i make click i set the viewstack page/canvas and the index in the datagrid...

      I really don't understand.

      Thanks a lot!