Okay
  Public Ticket #1123315
different colours for select box
Closed

Comments

  • matthall_5 started the conversation

    hi there,

    We're developing an very simple app to allow people to manage their bladder inputs and output ;-). 

    Believe it or not, one of the features of the app is to select the colour of their urine. 

    So far I've been able to display colours in the table displaying the data using conditional formatting, however we need to be able to display these colours in the input form as a select box (or other multi-value selector)           

    Anyone got any ideas how this could be achieved? 

    Cheers

    Matt 

  • [deleted] replied

    Hi matthall_5,
    Thank you for the purchase.

    Unfortunately something like this is not possible out of the box, but it can be done with some custom coding. With built-in features it is possible only to use text in selectboxes/multi-value selectboxes. Probably it can be done with some custom CSS that you can add directly on your page between <style> </style> tags. Please send me the link of your table so I can take a look at it.

  •   matthall_5 replied privately
  • [deleted] replied

    Hi matthall_5,

    Sorry for delayed reply, the ticketing system was not working yesterday.

    When I go to your page Not found, error 404 can you please check that your page exists and it is published?

  • matthall_5 replied

    Hi Milos,

    Apologies the page got moved to here http://118.127.45.165/~mybladdermylifec/?p=116

    Matt

  • [deleted] replied

    Hi Matt,

    You can add this CSS on wpDataTables settings page in Custom CSS field or directly on the page between <style></style> tags.

    #table_1_edit_dialog > table > tbody > tr:nth-child(7) > td:nth-child(2) > div > div > span:nth-child(1) {
        background-color: #dd3333 !important;
    }
    #table_1_edit_dialog > table > tbody > tr:nth-child(7) > td:nth-child(2) > div > div > span:nth-child(2) {
        background-color: #999414 !important;
    }
    #table_1_edit_dialog > table > tbody > tr:nth-child(7) > td:nth-child(2) > div > div > span:nth-child(3) {
        background-color: #4e40cb !important;
    }
    

    This is for first 3 options. Just change the last number to change the option and this should work.