0 Replies Latest reply on Dec 16, 2009 1:03 PM by PrimoDolce

    How to add delete button for ocmponents in TileList

    PrimoDolce

      I have a TileList that received text components. I would like to add a button that when clicked, removes the text item and renumbers the items.

      How would I do this and where would I inject the command?

       

      Code below:

      ------------------------------

       

          <mx:TileList width="320" height="100%" id="ImgList" dataProvider="{snapArray}" columnCount="1"
                        rowHeight="150"
                        cornerRadius="5" borderStyle="solid"
                        paddingLeft="2" paddingTop="2" paddingRight="2" paddingBottom="2"
                         backgroundColor="#EEEEEE">
                  <mx:itemRenderer>
                      <mx:Component>
                                          <mx:HBox verticalAlign="middle" horizontalGap="5" cornerRadius="5" borderStyle="solid"
                                              paddingLeft="2" paddingRight="2" paddingTop="2"
                                              width = "100%"
                                              height= "100%"
                                              >
                                              <mx:Image width="150" height="100%" source="{data.image}"/>
                                              <mx:VBox width="100%" height="100%" verticalAlign="middle">
                                                  <mx:TextInput id="titleEdit" text="{data.title}" styleName="smallLabel" color="#F05827" width="100%" textAlign="left"
                                                       change="data.title = titleEdit.text"
                                                      />
                                                  <mx:TextArea id="descEdit"
                                                      text="{data.desc}"
                                                      styleName="smallLabel"
                                                      color="#F05827"
                                                      fontWeight="normal"
                                                      width="100%"
                                                      height="100%"
                                                      textAlign="left"
                                                    maxChars="500"   
                                                      change="data.desc = descEdit.text"
                                                      />
                                              </mx:VBox>

       

                                          </mx:HBox>
                      </mx:Component>
                  </mx:itemRenderer>
                  </mx:TileList>