Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>One of the problems I see is that the Name fields is editable. If the field is changed, all the overlapping has to be recalculated. Not only is that is a performance issue, it is also a usability problem: what if one wants to change a name and the script, seeing discrepancies, forbids it?</p> <p>A solution would be to change the table to one resembling the diagram below:</p> <pre><code>[ Add Employee ] | Name | Start | End | Wages | ========================================== | | 0 | 50 | 100 | | Brian | 50 | 70 | 150 | | | 100 | 150 | 200 | | [ Add Rule ] | ------------------------------------------ | Another | 0 | ... | etc | </code></pre> <p>The [ Add Employee ] button would ask for a name and add a cell in the first column, and a line in the next three: with a default Start value of 0. The user can then enter data on the next fields, and can [ Add Rules ] as wanted. A good restriction could be to lock the values of the Start column and set them to the End value of the previous line.</p> <pre><code>$('#Brian .LineN input.start').val( $('#Brian .LineN').prev().find('input.end').val() ); </code></pre> <p>Then adding a comparison function to check if the End value is lower than the Start value is trivial to implement.</p> <p>Deleting a rule could simply follow the same procedure as for adding a line: the line below the one deleted (if any) would set its Start value as the now previous line's End.</p> <p>The real difficulty would be to insert lines at arbitrary points. I'm not going to think about that one, though.</p> <p>EDIT: If a rewrite is out of the question, then just disabling the start should be enough. However, IMHO I would rather (re)write something with no caveats than spend time later on numerous bugs and feature requests.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload