2

I have an unusual question regarding how displayed data should look as opposed to how to code the solution. I really don't know where to ask this.

I have a table that contains settings for a web application and an admin page where these settings can be updated. Some of the settings contain values (ie. days_to_display = 5) and some of them are just straight up boolean values (ie display_days = true). So I have setup my table as follows:

id(int), date_created(date), key(text), value(text), enabled(boolean)

I also want each setting to be able to be individually disabled. So my database would like such:

1    |     <date>     |    rule.days.to.display     |    5     |    T
2    |     <date>     |    rule.display.days        |  <null>  |    T
3    |     <date>     |    rule.hide.sunday         |  <null>  |    F
4    |     <date>     |    rule.start.of.week       |  Sunday  |    T

Here's an example of what it looks like: http://prnt.sc/azuwyl

I cannot think of a cleaner way to show the combination of text and boolean values together.

Just for completion: Java backend, Tomcat, JSP pages, PostgreSQL database

4

I see several points where your solution can be optimized:

  1. The most important column in your table is setting state. If a setting is disabled the rest of the values are irrelevant. Therefore, I suggest to put that column first.
  2. The most common way of displaying boolean values is checkboxes. So you may use them instead of true/false. If you want to go a bit more fancy dim/gray out inactive settings. Also you may try an option with led-indication instead of checkboxes (see below).
  3. I suggest to make all settings editable in place, rather than providing an edit button. User can start editing by clicking a value in the table. Finish editing by pressing enter/leaving the cell/clicking done button - choose whatever sounds more appropriate.
  4. If possible use names optimized for human reading, not machine names.

So in the end you may have something like this:

enter image description here

  • Thanks, I'm working off of existing code on a project that I took over and was hoping to keep things consistent in the UI (other areas use the edit buttons with a modal to input changes) but in the end I think I'll just go with a more modern approach like your examples – Chris May 5 '16 at 3:13
2

Take a step back and look at how a calendar with similar parameters abstract the database information into a UI.

enter image description here

Instead of a like-for-like view on the database, work out what you're letting the user do, then build the UI around that.

So instead of 'how do I display both string and boolean?', the question becomes 'what is the layout of the options the user has?' which hopefully is a slightly more approachable problem to solve.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.