Want to implent CheckBox for itemRenderer and headerItemRenderer for spark DataGrid.

I am using mx:DataGrid in my application.
The first column itemRenderer and headerItermRenderer is CheckBox.
Now I want to move it to spark DataGrid. I could imprement itermRenderer easily by creating sub-claassing GridItemRenderer. But I am struck at implementing headerItermRenderer. I tried to implent it using GridItemRenderer sub-class as I did with itemRenderer. It is not working. The set data method is not getting called.
Do anyone have code for implenting checkbox as itemRenderer and headerRendere in spark datagrid (and not mx datagrid)?
Thanks,
Prithvee Zankat.

Hi,
Item renderer can be implemented for spark and i think you will have to write custom header renderer. I am providing some useful links,please go through them :
http://help.adobe.com/en_US/flex/using/WS0ab2a460655f2dc3-427f401412c60d04dca-7ff3.html
http://cookbooks.adobe.com/post_3_state_checkbox_for_header_renderer_in_datagrid-18900.htm l
http://blogs.adobe.com/aharui/category/item-renderers
http://boardreader.com/thread/Spark_Datagrid_custom_header_renderer_1zw07Xgoeo.html
Thanks and Regards,
Vibhuti Gosavi | [email protected] | www.infocepts.com

Similar Messages

  • Setting font style on hover for spark datagrid

    I'm trying to skin a Spark datagrid. I have most things sorted by creating a custom skin, but one thing I can't find is how to set the colour of the row's font on hover. I can set the background colour fine, but how would I go about changing the font colour when a user hovers over the row?
    Thanks

    Hi
    You don’t actually deal with the text that’s displayed in the a datagrid inside of the skin
    Look at item renderers for the grid columns. You can style your text or whatever else you would like to display in the grid, in the renderer
    Hope that helps a little
    If you are still stuck just let me know and I’ll send you some code
    Cheers
    g
    heres some code
    NOTE: I am making this up as I sit here so I may be forgetting something. Don’t be surprised if this doesn’t work, but the basic idea is right I think
    So in the spark datagrid when you set your column (if you use mxml) this will replace a glob renderer so you can have a different one for each column if you wish.
    <s:GridColumn dataField="Status"
    headerText="name"
    width="37"                                                    
    itemRenderer="fooRenderer"
    />
    Or set a gloabel renderer in the grid def itself
    <s:DataGrid itemRenderer=”fooRenderer” />
    Then write a custom renderer: fooRenderer.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                         xmlns:s="library://ns.adobe.com/flex/spark"
                         xmlns:mx="library://ns.adobe.com/flex/mx"
                         clipAndEnableScrolling="true"
                         >
           <fx:Script>
                  <![CDATA[
                         override public function discard(willBeRecycled:Boolean):void
                               labelData.text="";
                               super.discard(willBeRecycled);
                         override public function prepare(hasBeenRecycled:Boolean):void
                               if(data)
                                       // set the colour of the text label to black
                                      labelData.setStyle("color",0x000000)
                                      // put some logic here to dynamic style the label
                               //check for the 'format' function on the column  (THIS MAY BE WRONG)
                               if( column.labelFunction != null )
                                      labelData.text = column.labelFunction( data, column );
                               else
                                      labelData.text = data[column.dataField];
                         super.prepare(hasBeenRecycled);
                  ]]>
           </fx:Script>
           <s:Label id="labelData" />
    </s:GridItemRenderer

  • Create custom scrollbar for Spark Datagrid

    I had a custom scroll bar for a MX datagrid.  But recently I got the new Flash Builder 4.5 and it said to use the Spark Datagrid component instead.  So I changed everything to Spark, but now I can't find any info on customizing the scroll bar.  Is this possible?  Should I go back to mx?
    According to the documentation in Flash Builder:
    "The Spark DataGrid control provides the following features:
    - Custom skins to control all aspects of the appearance of the DataGrid control"
    So I'm hoping it's possible but I can't find any info either way.

    Thanks.  I'm not sure exactly how I did it, but I started with this document in Flash Builder Help:
    "Setting a custom horizontal scroll bar skin on a Spark List control in Flex 4"
    I copied the code and changed "s|List" to "s|Datagrid", modified it accordingly for a vertical scroll bar, and I deleted references to "base color" so that it would compile.   Then, I copied in VScrollBarTrackSkin.mxml and VScrollBarThumbSkin.mxml from the Flash Builder directory: Adobe Flash Builder 4.5\sdks\4.5.1\samples\themes\zen\src\zen\skins.  And I removed the references to the swf files so that it would compile.  Then I embedded my own png images, e.g.: source.up="@Embed(source='/images/thumb.png')". And I got a scrollbar!
    Only problem is the example does not have up and down controls.  But I figured this out from looking at the zen skins (VScrollBarSkin / HScrollBarSkin) and copying in the code for the up and down buttons as well.  Now it's working pretty good.
    [I did not use any of the Flash Builder wizards/GUI to create the skins or files.  I just created the files individually (as in File - New - File).  Perhaps there's a better way to do it, but this worked for me.]
    I'm not sure why you suggested looking at "ScrollerSkin".  This didn't lead me anywhere, though perhaps I was not clear in my question.  But I greatly appreciate your answer, for saying that this is possible, otherwise I would have given up!

  • Error while creating a custom combobox for Spark DataGrid

    I am getting the following run time error:
    Error: Required skin part openButton cannot be found.
        atspark.components.supportClasses::SkinnableComponent/findSkinParts() [E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\componen ts\supportClasses\SkinnableComponent.as:671]
        atspark.components.supportClasses::SkinnableComponent/attachSkin()[E: \dev\hero_private_beta\frameworks\projects\spark\src\spark\components\ supportClasses\SkinnableComponent.as:646]
        atspark.components.supportClasses::SkinnableComponent/validateSkinCha nge()[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\com ponents\supportClasses\SkinnableComponent.as:406]
        atspark.components.supportClasses::SkinnableComponent/commitPropertie s()[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\compo nents\supportClasses\SkinnableComponent.as:420]
         atspark.components.supportClasses::ListBase/commitProperties()[E:\dev  \hero_private_beta\frameworks\projects\spark\src\spark\components\supp  ortClasses\ListBase.as:808]
        atspark.components::List/commitProperties()[E:\dev\hero_private_beta\ frameworks\projects\spark\src\spark\components\List.as:954]
        atspark.components.supportClasses::DropDownListBase/commitProperties( )[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\compone nts\supportClasses\DropDownListBase.as:504]
        atspark.components::ComboBox/commitProperties()[E:\dev\hero_private_b eta\frameworks\projects\spark\src\spark\components\ComboBox.as:644]
        atmx.core::UIComponent/validateProperties()[E:\dev\hero_private_beta\ frameworks\projects\framework\src\mx\core\UIComponent.as:8095]
         atmx.managers::LayoutManager/validateClient()[E:\dev\hero_private_bet  a\frameworks\projects\framework\src\mx\managers\LayoutManager.as:934]
        atmx.core::UIComponent/validateNow()[E:\dev\hero_private_beta\framewo rks\projects\framework\src\mx\core\UIComponent.as:7953]
        atspark.components.supportClasses::GridLayout/layoutItemRenderer()[E: \dev\hero_private_beta\frameworks\projects\spark\src\spark\components\ supportClasses\GridLayout.as:1808]
        atspark.components.supportClasses::GridLayout/createTypicalItemRender er()[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\comp onents\supportClasses\GridLayout.as:460]
        atspark.components.supportClasses::GridLayout/updateTypicalCellSizes( )[E:\dev\hero_private_beta\frameworks\projects\spark\src\spark\compone nts\supportClasses\GridLayout.as:514]
        atspark.components.supportClasses::GridLayout/layoutColumns()[E:\dev\ hero_private_beta\frameworks\projects\spark\src\spark\components\suppo rtClasses\GridLayout.as:570]
        atspark.components.supportClasses::GridLayout/measure()[E:\dev\hero_p rivate_beta\frameworks\projects\spark\src\spark\components\supportClas ses\GridLayout.as:230]
         atspark.components.supportClasses::GroupBase/measure()[E:\dev\hero_pr  ivate_beta\frameworks\projects\spark\src\spark\components\supportClass  es\GroupBase.as:1109]
        atmx.core::UIComponent/measureSizes()[E:\dev\hero_private_beta\framew orks\projects\framework\src\mx\core\UIComponent.as:8383]
        atmx.core::UIComponent/validateSize()[E:\dev\hero_private_beta\framew orks\projects\framework\src\mx\core\UIComponent.as:8307]
        atspark.components::Group/validateSize()[E:\dev\hero_private_beta\fra meworks\projects\spark\src\spark\components\Group.as:956]
        atmx.managers::LayoutManager/validateSize()[E:\dev\hero_private_beta\ frameworks\projects\framework\src\mx\managers\LayoutManager.as:659]
        atmx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\hero_priv ate_beta\frameworks\projects\framework\src\mx\managers\LayoutManager.a s:793]
        atmx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\h ero_private_beta\frameworks\projects\framework\src\mx\managers\LayoutM anager.as:1157]
    Here is my combobox:
    package
        import mx.controls.listClasses.BaseListData;
        import mx.controls.listClasses.IDropInListItemRenderer;
        import spark.components.ComboBox;
        public class sparkComboRendererDataGrid extends ComboBox implements IDropInListItemRenderer
            public function sparkComboRendererDataGrid()
                super();
            public function get listData():BaseListData
                return null;
            public function set listData(value:BaseListData):void
            override public function set dataProvider(value:Object):void
                super.dataProvider = value;
                // This may get called before dataProvider is set, so make sure not null and has entries
                if (value!=null && value.length)
                    // Got it, set flag
                    bDataProviderSet = true;              
    and here is the implementation:
    var PersonnelPerson:ClassFactory = new ClassFactory(sparkComboRendererDataGrid);
    PersonnelPerson.properties = {labelField : "person", dataProvider :
    new XMLListCollection(dataList.consistcrew)};
    var col:GridColumn = GridColumn(personnel.columns.getItemAt(0));                   
    col.itemRenderer = PersonnelPerson;
    Please help.
    Thanks

    Actually, after adding the following code it started working:
    import spark.skins.spark.DropDownListSkin;
    override public function stylesInitialized():void
          super.stylesInitialized();
          this.setStyle("skinClass", DropDownListSkin);

  • Use labview to read an Excel file to some control and add a checkbox for each row

      As the subject say,I need to use labview to read an excel file,and show it in some control,such as mclb;then ,I should add an checkbox for each row,enable me to choose the row i want.What should I do ? Many Thanks.
    Solved!
    Go to Solution.

    Hi,
    to answer your question:
    - read an excel file
    - show it in some control, such as a MCLB
    - add an checkbox for each row
    - choose the row you want
    Hint to make it easier: I wouldn't use checkboxes, as the MCLB already allows to select rows by mouseclick…
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • I just bought a new mac mini and an external DVD burner. I want to burn a DVD video and it will not play on the TV but only on the computer? Need this figured out for tomorrow.

    I just bought a new mac mini and an external DVD burner. I want to burn a DVD video and it will not play on the TV but only on the computer? Need this figured out for tomorrow. Can anyone help me?

    Congratulations on the new Mini. Are you saying you tried burning and it does not play, or do you want to burn it only for the computer to be able to play it?
    OS X Mountain Lion: Burn a CD or DVD may help.

  • Since you don't allow emails any more – I suspect because of the numerous complaints with your service and the way you treat people that you don't want documented, I am calling and I want this call recorded for future reference. I have been a long time fa

    Since you don’t allow emails any more – I suspect because of the numerous complaints with your service and the way you treat people that you don’t want documented, I am calling and I want this call recorded for future reference.
    I have been a long time faithful customer of vzw and although the past year I have been late on payments many times and really couldn’t afford your exorbitant prices for services lots of other companies offer sometimes three times cheaper than what you charge, I have hung in there trying my best to meet my obligations.
    This month has been no exception. You don’t know the background; the whole story of people’s lives. I know you could care less because all you care about is the profit-the money that comes in.
    I was told when I agreed to pay my bill on the third per the recorded message that I had 14 days to pay…you cut me off anyway. The phones are not the tissue; your suspending my service means I cannot work. I may lose my job…how do you justify that? In any case? The least you could do would be to keep 4986 on and cut the phones off. But no. You refuse to compromise and meet the basic needs of your customer. What does that say about your company? I tried to call back on three separate occasions to tell you I couldn’t pay because of unexpected expenses but couldn’t get out of the automated system…sadly couldn’t get to a real person which also speaks volumes to me.
    All this tells me this is a company I don’t wish to be affiliated with any more. As soon as I can, I will discontinue service with you…I know you could care less. I will honor the remaining portion of the contract but that’s it. You don’t deserve my business. I am a good, hardworking person who, at the sacrifice of myself and my needs, always pays her bills…albeit late at times. I realize others tell you stories and lies to justify themselves. That’s not me. If you knew what I had been through the last 7 yrs you would marvel that I am  still on my feet…don’t judge too quickly. You could be wrong…and in my eyes you are by doing this to me.
    God will see us through this extremely scary time of that I have no doubt. No thanks to your company and lack of understanding and mercy. I am doing the best I can. Sadly you are not.
    See I have choices. MANY choices of providers for services you offer. I don’t have to be treated like this. I don’t have to succumb to your coldness and callousness. I intend to choose better (and cheaper). If your company doesn’t get the “people factor” back you will be sorry.

    Problem here is you admit you cannot afford the service.
    And you want to blame Verizon for losing a job because you have no cell phone.
    If your job depends on that phone I would pay it on time every time if you need a job to pay your bill.
    No other service is going to treat you any different. And if you cannot afford Verizon's monthly invoice how are you going to afford new devices, activation fees, possible security deposits on any other cellular carrier? You can't.
    Also if you made an arraignment to pay and then decide you cannot do so, why should Verizon extend you service or credit, or why is it you want to use the service and data and not pay for it as agreed.
    Get a prepay phone. Its evident the cost is too high for you to afford on post pay.
    Good Luck

  • I have 4 devices, itunes account with a yahoo email. I want to mainstream all on itunes and icloud for my "me" account !!!

    I have 4 devices, itunes account with a yahoo email. I want to mainstream all on itunes and icloud for my "me" account !!! How do I go about doing this ???
    iphone 4, ipad 2 , ipod touch itunes account is an yahoo address.
    I have and use a ME.COM account.
    I would like to mainstream ALL and have benefits of iCloud !!!!!!!
    How do I go about doing this???

    You can't merge accounts.  Just continue to use your Yahoo ID for iTunes, and your iCloud ID for everything else.

  • For some reason osx mountain lion has disappeared from my purchases and now when i want to install mountain lion on another mac with the same apple id it wants to charge me for the program even though i have already purchased it. what do i do?

    for some reason osx mountain lion has disappeared from my purchases and now when i want to install mountain lion on another mac with the same apple id it wants to charge me for the program even though i have already purchased it. what do i do?

    Open the Mac App Store on the other Mac and in the Quick Links sign into your account. See if the Mountain Lion purchase is among hidden apps in the iCloud area of your account info.

  • Hi, I have apple account/password on laptop but can't use the same ID etc on new Ipad.  On my account it says ID is only for 1 system.  I really want only one ID for both Ipad and laptop. Thanks

    Hi,
    I have apple account/password on laptop but can't use the same ID etc on new Ipad.  On my account it says ID is only for 1 system.  I really want only one ID for both Ipad and laptop.
    Thanks

    It seems that you have used the AppleIDs to "Purchase" your devices, which marries the two for all time and eternity.
    For info - Using your Apple ID for Apple services
    For Account security issues - Apple ID: Contacting Apple for help with Apple ID account security
    regards
    CCC

  • HT204161 I want to use iCloud for every thing else except for Messages. I do not want to send an iMessage and receive it on both my iPhone and Mac.

    I want to use iCloud for every thing else except for Messages. I do not want to send an iMessage and receive it on both my iPhone and Mac.
    How do I do that?

    Howdy kingtonz,
    If I understand you correctly, you want to limit to limit your use of the Messages application to non-iCloud sources such as text messaging through your phone carrier, is that right?
    You can turn off the use of iMessages in Settings > Messages > iMessage. See this help article -
    Messages settings - iPhone
    Thanks for using Apple Support Communities.
    Best,
    Brett L 

  • I have two time capsules (1TB, 2TB) and want to use one for another set of Macs (my Family). How do I set both up and keep all the Macs from joining both Time Capsules?

    I Have two Time Capsules (1TB and 2TB) and want to set one for business and the other for family - networking seperate Macs to each.

    Both should be plugged into the network with ethernet.. if at all possible.
    If you have a router already then both bridged otherwise one set to router and one to bridge.
    How do you access the TC? Ethernet or wireless?
    Are they located in the same area?
    You could set different wireless networks.. if they use wireless.. this is nice easy way to do it.
    You can set user account in the TC you want the business one to join with.. that will prevent access by the family.
    So there is a number of ways.. none are particularly secure btw.. the TC is a home not a business device.. if anybody wants access they press the reset for one second.. pofff all the passwords are default for 5min.. to allow people who forget their password to get access.
    On ML you can encrypt TM backups.. this is better for security if that is the problem.. and still use different user profile to prevent access.

  • HT203167 Hi, I've purchased a few films from itunes (and they are listed as Purchased in my account), but I can't find them on my computer or on my itunes account, and itunes wants me to pay for them again. How do I get around this?

    Hi, I've purchased a few films from itunes (and they are listed as Purchased in my account), but I can't find them on my computer or my itunes account, and itunes wants me to pay for them again. How do I get around this? I've tried all the suggestions, and it's hugely frustrating.

    If you are in the UK, and the film studio allows re-downloading, and you are signed in with the same account that you bought them with, then they might show under the Purchased link under Quinklinks on the right-hand side of the iTunes store home page for re-downloading - if they don't show then check to see if they are hidden (hiding and unhiding).
    But you should be keeping and maintaining your own backup of your downloads and noy rely on being able to re-download any item as they are occasionally removed from the store by the content provider (film studio, tv company, record company etc).

  • I have always paid for apps with a credit card and now need to use an app store card but I can't get past the point where it keeps wanting my credit card updated.  And can't used the app card number.  Any advice???

    I have always paid for apps with a credit card and now need to use an app store card but I can't get past the point where it keeps wanting my credit card updated.  And can't used the app card number.  Any advice???

    I do NOT like using my credit card if I don't have to, and I went out of my way to go buy an Apple gift card, which I successfully redeemed into my Apple account. However, when I use the Apple "Cards" app, it will not let me use anything other than my credit card. I tried purchasing a card, hopefulling it would come out of my Apple store balance, but no such luck -- it came out of my credit card.
    Apple is becoming more like Microsoft every day.

  • I want to accumulate rain for the day, month and year; What formula can I use?

    I want to accumulate rain for the day, month and year; What formula or expression can I use.
    I am using a Rain Wise product that converts pulses to an analog value.  The Rain Wise device can be
    set to measure up to 1", 5", or 10".  I will be setting the unit to 10 inches in increments of 0.01 inches.
    What I would like to do is everytime the signal increments I would like to count it as 0.01 then after reaching
    a period of time whether it be a day or a month reset back to zero.
    Need some advise on this problem.
    Solved!
    Go to Solution.

    Hello Ryan,
    Lookout gets a Modbus over Ethernet signal which originates as a 4-20mA input to a Moxa Ethernet I/O Module (E1240) in the field.  In Lookout I created a ModbusEthernet Driver and a tag which scales 0 - 65534 RAW to 0-10 Eng.  [0 - 10 is inches of rain]  Also, another piece of information is that after the rain gauge maxes out at 10 inches it will zero out and start over.
    I though the accumulator was time based and took a sample over a specific time period, for instance, one sample every 30 seconds then accumulate.  If this is so then if I have 5 inches of rain and then it stopped raining, then 30 seconds latter it would sample, it would see 5 inches and add that to be 10 inches when actually it had only rained 5 inches. 
    I really need some help with this process,
    David Lopez
    City of Corpus Christi

Maybe you are looking for

  • Showplan follow up question

    Follow up on question regarding thread: showplan questions The second query (after updated index), any reason why the operation is TblLkTtreeScan instead of RowLkTtreeScan? I updated the optimizer stats and it still shows up as a TblLkTtreeScan. What

  • TS3276 error message when trying to send email

    On my Apple Iphone 3G, using Rogers as a cell provider, when an email came in and I tried to reply to it, it came up with an error message " A copy of this email has been placed in your outbox. The senders (me) address "[email protected]" was rejected b

  • Can't scan or connect to WPA network since kernel upgrade

    Hi guys, I upgraded to kernel 2.6.29 earlier today and have been having trouble with scanning and connecting to WPA encrypted networks since. I'm stuck with a wired connection for the minute, but I can't have the wire going through the house for so l

  • Help with shared objects...again...

    Okay, I've been looking at a really good tutorial for shared objects in AS2, and I think I've gotten the basic concept down of how they work... now the problem lies in just integrating it into what I already have, which is making my brain hurt.  Basi

  • Use updates repository during OS installation?

    I'm building a RHEL6 VM with VMWare Studio at present. One of my requirements is to have the OVA pre-patched with all the latest available OS updates from Red Hat. I managed to get this working by adding an application pre-install step that temporari