facebook

How to toggle the background colour of a list item?

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #331822 Reply

    paulD
    Member

    Hi everyone

    Just wondering if someone could help me with a simple problem. I would like to toggle the background colour of an list item when its clicked and not sure how to go about it. Would it be possible for someone to do a very quick demo for me, i’ve tried a few JS toggle examples of the net with no luck.

    If the item is in a parent container do you have to reference the parent ID in the code? for example in action script i would do parentList.listItem.visible = false;

    sorry i’ve never touched JavaScript before! Maybe i need to do some tutorials!!!

    Thanks for any help

    Paul

    #331830

    support-michael
    Keymaster

    @paulD

    Can you share more details on what the list-item background change is meant to reflect? For example are you simulating a SelectionList where selected items have a highlighted background? Just curious!

    #331832

    paulD
    Member

    Hi Wayne

    Thanks for getting back to me. I am making checklist and so its easier to see the steps done, i just wanted to change the colour of the item.

    Thanks

    Paul

    Attachments:
    You must be logged in to view attached files.
    #331837

    Hi Paul,

    Attached is an example I created. It introduces a css rule in the sl_custom.css file that makes all selected SL items have a green background. I also turned off Highlight when Active property for each SL item. I used the Style Sheets property to include the sl_custom.css file into the project when code is generated.

    We plan introduce a new selectListItem property for selected background color based on your request.

    Attachments:
    You must be logged in to view attached files.
    #331849

    paulD
    Member

    Thanks it works really well. Could you very quickly explain how the css file is connected to the mobi file? How would i use this css in another project?

    Thanks again for the fix it works a treat.

    Paul

    #331868

    Hi Paul,

    You need to select the Design name on the top of the outline view, it will show the properties of your form and you should add your custom.css file in the CSS Style Sheets property. See attached image:

    See attachment slcolor.png See attachment slcolor.png

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: How to toggle the background colour of a list item?

You must be logged in to post in the forum log in