Welcome, Guest
  • Author Topic: Adding Picture and Pagination on dataGrid Flex.. :)  (Read 2014 times)

    hinomotoblade

    • Seasoned Programmer
    • ***
    • Posts: 131
    • Flash Never Die :D
      • View Profile
    Hello can i include the picture to my dataGrid?..
    And how about pagination?.. like we use mysql_limit in dataGrid.. :)

    About the dataProvider on my dataGrid i assign like this.. :)

    Code: [Select]
    <mx:Object ID="1" NAMA="Yogie Aditya" PESAN="Hehehehe SIP"/>
    <mx:Object ID="2" NAMA="Hikari" PESAN="Waaa XD"/>
    <mx:Object ID="3" NAMA="Hikaru Lala" PESAN="Iyah Sip Cuy"/>

    Thank you.. :)

    Really need help, :D
    Huihihi~ :D

    kofi addaquay

    • Global Moderator
    • Senior Programmer
    • *****
    • Posts: 450
      • View Profile
      • Scripton Interactive
      • Email
    Re: Adding Picture and Pagination on dataGrid Flex.. :)
    « Reply #1 on: 01/27/10, 17:47 »
    a friend of mine wrote a sample application to demonstrate pagination. check it out here

    http://examples.augiemarcello.com/Flex2/Pagination/Pagination.html

    right click and do view source code to see the code. that might help you out.

    Kofi

    hinomotoblade

    • Seasoned Programmer
    • ***
    • Posts: 131
    • Flash Never Die :D
      • View Profile
    Re: Adding Picture and Pagination on dataGrid Flex.. :)
    « Reply #2 on: 01/27/10, 19:04 »
    Thank you very much kofi.. :D

    How about adding picture in my dataGrid?.. Because i am using an Object for the data.. :)
    Huihihi~ :D

    kofi addaquay

    • Global Moderator
    • Senior Programmer
    • *****
    • Posts: 450
      • View Profile
      • Scripton Interactive
      • Email
    Re: Adding Picture and Pagination on dataGrid Flex.. :)
    « Reply #3 on: 01/27/10, 23:41 »
    the code you are using is not fully right. a datagrid needs to have a source / dataprovider. i dont see that in your code.

    you can create an array collection and using the object as your source

    <mx:ArrayCollection id="myAC">
        <mx:source>
               <mx:Object theUrl="http://kofi.com" theName="someName"/>
        </mx:source>
    </mx:ArrayCollection>

    you then set your datagrids dataprovider to this arraycollection. one quick way to access your object is like this ( using binding )

    {myAC.getItemAt(0).theName}


    About your image. datagrids dont show images by default. you will have to create a custom renderer for your datagrid to show images. look into the documentation on how to create a datagrid item renderer.


    Kofi

    hinomotoblade

    • Seasoned Programmer
    • ***
    • Posts: 131
    • Flash Never Die :D
      • View Profile
    Re: Adding Picture and Pagination on dataGrid Flex.. :)
    « Reply #4 on: 01/28/10, 20:57 »
    Yes thank you kofi.. :)
    Huihihi~ :D