How to disable items (gray out) in DataGrid control?

Hi,
I need to implement a custom component to have a selectable list with a maximum selected items.
that is, when the selected items reach the max number, all un-selected items will be gray out.
Now I am able to use DataGrid control to display a selectable "checkbox" (through itemRenderer) at first column, to let user select the item.
And the list name in second column.
But I can't find a way to gray out (disable) those un-selected item when max is reached.
Can anyone give any advise?
Here is my code snippet:
SelectableListView.mxml
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" visible="true">
<mx:DataGrid id="list_datagrid" dataProvider="{this.stringList}" showHeaders="false"
editable="false" selectable="true" verticalGridLines="false" borderStyle="none" alternatingItemColors="[#F8F8F0, #FFFFFF]"
left="5" rowCount="16" rowHeight="20" height="83" width="100%" top="0" doubleClickEnabled="true" doubleClick="onDoubleClick(event)" >
  <mx:columns>
    <mx:DataGridColumn id="listCheckBox_col" dataField="selected" editable = "false"
                                    itemRenderer="ListRenderer" width="18" headerText="" resizable="false" draggable="false"/>
    <mx:DataGridColumn id="listName_col" dataField="name" />
  </mx:columns>
</mx:DataGrid>
</mx:VBox>
ListRenderer.mxml
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="60" >
     <mx:Script>
          <![CDATA[
               private function setInUse() : void
                    _data.selected = listInUse.selected;
          ]]>
     </mx:Script>
  <mx:CheckBox id="listInUse" width="18" height="18" click="setInUse()" selected="{_data.selected}"/>
</mx:Canvas>

what is listInUse insdie the itemRenderer? I am not very clear about how you use
it. However there are 2 ways of doing it. Not sure if data.selected can be used
to enable/disable the itemrenderer. So I will asume not. Have an extra bindable
"enabled" property in your dataProvider model. So when you reach the maximum of
selected items iterate through the collection and set the set the enabled
accordingly. The renderer's enabled property is bound to the model's enabled so
it should update accordingly. The other way is to bind the enabled of the
renderer on the selected. But as I said I am not sure how your code works ...
HTH,
C

Similar Messages

  • Disable or Gray out the baseline field in miro

    Hi experts,
    Can any one help me for how to Disable or Gray out the baseline field in miro t-code
    I tried for user-exit and also for badi but i didn't get it.
    so please giude me
    Thanks & Regards
    Vishal

    sorry,
    it's baseline date fiels.

  • How to disable or grey out a link in detailed Navigation

    Hi All,
    We have requirement in which few of the links in are to be displayed as greyed out or disabled in detailed navigation and in navigational pages. This is to stop the users from accessing the link for sometime say for a week or so.
    I have managed to grey out the link in navigational area. But couldnt find a way to do it from Detailed Navigation. If i click on the link on detailed navigation, it would open the applicaton.
    Kindly help me on how to disable or grey out a link in detailed navigation.
    Thanks
    Namit

    Hi Namit,
    Open the particular page , and select dynamic navigation (from the right hand side corner Display drop down menu ) .
    U will get all the links which r there in the detailed navigation.
    and uncheck the visible property .
    Surekha.

  • ICloud items grayed out on MBP

    Hi all-
    Last night I had to change my password for iCloud as it was entered incorrectly too many times (think I was typing it wrong). I've successfully done that and able to login both online as well as iTunes store, etc.
    However, today when I booted my MBP, I was first greeted with a bunch of keychain warnings. I was able to cancel out of all of those then enter the new iCloud password and those warnings are no longer popping up at boot.
    My problem now is that, when I got to both "iCloud" and "Internet Accounts" in system preferences, everything is grayed out (the items I should be able to check). At the top of both of those screens there's a "enter password" button, which I hit. I then enter my new password. It accepts it, in both, yet the screen it takes me to...with Photos, Mail, Contacts, Calendars..." etc are all still grayed. I cannot adjust, tick any of the radio buttons, etc. Also, under my user icon on the left both "Account Details" and "Set Up Family" are also grayed, unavailable to click.
    Can anyone help? There is an option to "sign out" which I'm tempted to do and try signing back in, but then, when looking into that option I've read that items in iCloud stored on the mac will be removed. I don't want to risk losing data from this mac. Or will it all just be brought back into the MBP from iCloud once I log back in? OS X Yosemite: If you sign out of iCloud
    Is there anything else I should be doing? Or is the play here to Sign Out and sign back in? Thanks.
    Cory

    Now I have another issue, potentially. When trying to sign out, I use my Apple ID to log into my computer. So now, before I can log out, it's telling me that I'll need to set up a new password and that I won't be able to use my Apple ID password to sign into this computer. This is quite annoying. If I do this step, re-log back into iCloud, will I then be able to revert back, setting my MBP login screen to my iCloud password? That's how I wanted it...it was seamless, allowing the same login online as I use when logging into this machine.

  • Items grayed out when they should not be

    I have some apps where files that should be available for opening are instead grayed out when they shouldn't be. They never used to be grayed out until recently, and they are a correct file type. (Open is set to "All files" not just the file extension, so it's not an oversight).
    Which part of the OS is responsible for choosing what items will be available in a file list (i.e. not grayed out)? I'd like to rebuild it since it seems to be corrupted. Also my LaunchServices seems to be messed up as well because some apps are not available for certain file types "Open With" when they ought to be. Terminal command? Disk Warrior? TinkerTool? Thanks.

    Hi,
    If you aren't confident in using Terminal check out this site for help with Launch Services.
    http://www.thexlab.com/faqs/resetlaunchservices.html
    Carolyn

  • ITunes menu items grayed out

    I've had this happen with previous versions of iTunes and now with the most recent version of iTunes (running OS 10.7.2) all the iTunes Menu items are all grayed out, as well as all the other iTunes menues, with less than a hand full of commands availabe. Since the Quit iTunes is one of the options grayed out I've had to force quit iTunes and even after a relaunch the menu items continue to be grayed out. In search the Apple Communities for this subject I found references to this problem going back to 2008 and no one has offered a solution. One of the suggestions was to run Disk Utility and repair permissions, which I have done and it didn't solve the problem, but I hadn't restarted iTunes which I again did by force quitting, and on relaunch all the options are back working as they should. Not sure if repairing the permissions had any effect on iTunes as none of iTunes permissions were repaired, just scanner and printer permissions.

    I have this same problem and it's very annoying.
    What happens is this: I'll be happily editing my library when, after an edit, it suddenly becomes impossible to select "Get Info" to edit tracks. The menu item is grayed out and Command-I just gives a warning beep.
    At this point, it is also impossible to Quit iTunes as that menu item is also grayed out and Command-Q also gives a warning beep.
    One thing I have found is that I can still quit iTunes by right-clicking on the dock icon, obviating the need for a force quit.
    Another symptom: the iTunes dock icon is constantly jumping up for things that it didn't used to jump for.
    I've tried deleting the preference file. I haven't tried moving the library and library.xml files and rebuilding them, mostly because I've got 380GB of music on an Airdisk and it would take an eternity to rebuild the library.
    I'm really fed up with this and have no idea what to do.
    For what it's worth, the behavior started on my old machine running Snow Leopard and has continued after a clean install (albeit with iTunes information copied over) on a new machine running Lion (now 10.7.3).

  • Why is "Apply to enclosed items" grayed out?

    There is an archived thread on this issue but with no resolution. When I want to change permissions on the contents of a folder, very often the "Apply to enclosed items" button (in the Get Info Permissions panel) is grayed out.
    Why? What's the fix? Is this a bug?
    QuickSilver dual-800 G4   Mac OS X (10.4.7)   X Server

    You'll only be able to apply permissions to children folders using the Finder's interface (via the Get Info or Inspector window) if you're the file's POSIX owner or if otherwise your Effective Permissions return this control (e.g. the ability to perform writesecurity and chown via an applicable ACL entry).
    But, generally speaking, the POSIX owner is delegated as the user who can change permissions for a filesystem object. Any administrator who is authorized root privileges (can "su to root") can change permissions for any filesystem object. Workgroup Manager provides a simple interface for doing this, but you may want to familiarize yourself with the chmod and chown commands for greater flexibility.
    If you're using Mac OS X 10.4, you may find my ACL Tips to be useful: http://discussions.apple.com/thread.jspa?threadID=318161&start=0&tstart=0
    --Gerrit

  • Black screen & all menu items grayed out -help!

    Sorry folks, total AE nube here, in over my head already. Having just purchased AE CS3 I'm completely adrift.
    I was in the process of looking at & changing preferences when shortly thereafter my screen went All black. A friend suggested it may have something to do with the output display, which may be the problem, however, I have gievn up searching after 4 days trying different searches in the program help function with no joy.
    Apparently, I don't know "Adobe Speak" well enough to phrase the seach to get meaningful results. I did finally find that If I put the cursor at the very top of the screen & click I can then see the menu. Every dropdown list in the menu, is grayed out and no amount of pounding on the keys, gnashing of teeth, pulling hair, etc will allow me back in to the preferences where I suspect I misunderstood what the selection of "Cinema display" would do. Unfortunate that FCP 7 allows one to select that for a higher resolution view that I have in fact used before.
    If that was indeed my error, since even the preferences are grayed out, how does one reset preferences to factory default?
    OR
    Is this a problem of a different nature? The monitor works just fine in all other programs, so I don't bevieve that is the problem.
    Any help would be greatly appreciated.
    Ken

    Well,
    I just don't know why I keep buying this Adobe crap. Apparently, they must outsource all the programming to China, because it sure isn't written in a way that I can understand as an American. Like most of the big software companies, they do not provide either a clear path to or a coherent explanation of how to use the arcane & obtuse programming that makes up their fare. Of course, you never really know what you are getting into, because they don't make it clear just how difficult it is to learn or use.
    In their rush to make gobs of money, they seem to have forgotten that not everyone who purchases their crap has had enough prior experience to undestand the little known secrets of how to find out what to do when all goes wrong.
    It is the same mistake that many programmers the world over make day in & day out, they can't concieve that those who have no familiarity with the way they see how to make their software work, find their software unfathomable. THE NEWS FLASH IS THAT NOT EVERY ONE KNOWS WHAT YOU KNOW ABOUT HOW TO MAKE SOFTWARE WORK. The attitude seems to be: "Anyone who doesn't know the secrets of the brotherhood shouldn't be using it!"
    As one who once went through the rigors of obtaining a CS degree (and actually considered starting a software company), it became obvious (20 years ago) that the future was not how many tricks you could make the pony do, but rather how intuitive you could make the software to allow the intended user to operate it without having to know it's arcane secrets AND to make it fault tolerant and self healing as much as possible. The telephone is a reasonable analogy, very few people know how it works, but they sure can use it until the cows come home with very few operator errors. In short, the technology is virtually transparent to the user.
    I realize that company cultures rarely change unless an outsider is brought in to clean house and start afresh and that the likelyhood of that happening at Adobe is about the same as winning the Powerball lotto Jackpot 3 times in your life. I guess that makes me a modern day Don Quixote, but so be it. I also know that EVERY organization that does not change it's approach to the marketplace will eventually be replaced by some upstart who figures out a way to do it better.
    So, ladies & germs, I did what anyone who uses a telephone would do when you aren't making any progress, I hung up the phone (un-installed the program) and stopped trying to figure out the technology that keeps my screen black AND does not allow me to undo the prefs quickly, and with a new dialtone, I redialed the number (re-installed). A clever little monkey am I.
    If it happens again (or something similar) I'll bring my disk and man's best friend to the park for a stress bustin game of frisbee!
    Adobe, it really is the 21st century, and you have failed miserably at meeting the future of making software more transparent to the user !
    Ken
    P.S. - For the record, I've been in an altered state (call frustration) for 20 years worth of Adobe products, and the light at the end of their tunnel, IMO is an oncoming train.

  • Product Menu items grayed out in Xcode

    I am a beginner in Xcode, I was working on a tutorial material with a basic calculator project and when I added an icon file to the project the Run or any of the Product Menu options got grayed out. Previous to this change everything was running and building fine. Can anybody advice on how to get the Run option to be available again? My guess is that I did something wrong at the time of adding the new icon file to the project but I cannot figure out what was it.
    I don't want to start all over.
    Thanks,
    Mario

    Mark:
    Thanks for the reply, I tried all options mentioned and nothing worked thou. What I decided to do is to use my timemachine backup and used the closest version to the last time the project ran properly, now I only have to re do just a portion of the project.

  • Menu items grayed out in Messages.

    Most menu items are grayed out in Messages: can't access preferences or account, among others. Just upgraded to Yosemite on Mid2010 Mac Pro.

    Okay, just by posting this request, I was finally directed to some more similar discussions that I couldn't find earlier. Buried within numerous, numerous suggestions to this issue, I finally found one I hadn't tried - booting briefly into Safe Mode, then restarting. For some utterly ridiculous reason, that appears to have solved the problem when nothing else would.
    So thanks, community, for finding the answer before I asked.

  • Photoshop CS3 10.0.1 - Launch hangs on Registration Screen, All menu items grayed out

    I'm using Adobe Photoshop CS3 10.0.1.
    When launching, the window labeled "Adobe Design Suite Premium CS3" opens - it's only filled with white, and no text or graphics (I think it's usually the window asking me if I want to register, which always comes up when I launch the program (rather annoying in itself).  However, now it seems that the launch gets "hung" on this window, as, even the the program starts, all the menus are grayed out, and I can't open any files or do anything.  Also, the window mentioned above only has the yellow "minimize" button available in the top left corner, so I can't close it or otherwise get rid of it.  Since even the Quit function is grayed out, I have to quit the program with a force quit.  Also, this same thing happens in my other CS3 programs (In Design) as well.
    I tried trashing the photoshop plist file (com.adobe.photoshop.plist) and also the com.adobe.118.registration file, which had no effect.
    Any advice on how I can fix this?
    Thanks!

    Hopefully this solution will work for you:
    http://forums.adobe.com/thread/1339100?tstart=30

  • Host Compliance Report - Available Items Grayed out

    Trying to run a host compliance report against discovered assets.
    Under 'Available Items' --> "Operating Systems" --> "Solaris" --> "Solaris 10" I have a list if my discovered systems (I can see/manage them in 'Assets') but they are grayed out and I cannot select any of them to move to 'Target List" to run the report against.
    Let me know what additional information is needed to help offer a solution.
    Thanks in advance,
    John

    Hi,
    If you aren't confident in using Terminal check out this site for help with Launch Services.
    http://www.thexlab.com/faqs/resetlaunchservices.html
    Carolyn

  • "Only sync checked items" grayed out

    I've updated iTunes to the newest version and my 5th gen. iPod to v1.2. I'm trying to get the box on the iPod summary page to become "checkable"... it's the "only sync checked items" box, and it's grayed out... without it, the way I manage my podcasts becomes entirely screwed up. Anybody?

    I've got the same problem. Two days and no reply yet? What's especially troubling is that syncing only checked items had been my preference under iTunes 6. ITunes 7 should have kept all the same preferences.

  • Photoshop Elements 4 menu items grayed out after opening from iPhoto

    Hi,
    I just set PSE4 as my preferred photo editor in the General Preferences pane of iPhoto '08. When I edit a photo in iPhoto, PSE4 boots up (as expected and desired); however, all the menu items are inexplicably grayed out now in PSE4, so doing any editing is impossible unless keystrokes are used. Unfortunately, I don't know what all the keystrokes are for various functions, if keystrokes exist for each... Does anyone know anything about this? Gurus, please help! Advance thanks.

    Heheh: the inexplicable mysteries of the digital universe. Opening PSE4 up first, and then editing the photos in iPhoto so they appear in PSE4 worked! The menu items were no longer grayed out - all functional. Thanks Terence!

  • Additional download item grayed out

    I upgraded to the new version and tried downloading the additional content. At one point it complained that the download failed although it did seem to install sme of it.
    However, the menu item is now grayed out so I'm unable to try again. Is there anyway to reset this?

    dhjdhj wrote:
    I upgraded to the new version and tried downloading the additional content. At one point it complained that the download failed although it did seem to install sme of it.
    However, the menu item is now grayed out so I'm unable to try again. Is there anyway to reset this?
    Have you tried moving the MS preferences to the Desktop?
    Log in under a different User a/c?
    Trash the M/S app and start again?
    HTH
    CCT

Maybe you are looking for