Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • fields incorrectly aligned with readOnlyDisplay:static, textAlign:right, canEdit:false

    isc version v12.0p_2018-08-22, browsers Chrome, Edge and IE

    When using a DynamicForm with readOnlyDisplay:static and TextItem-derived field types (eg FloatItem, IntegerItem) with textAlign:right and canEdit:false the fields do not align correctly at their right edge.

    We have prepared a standalone test page which we have uploaded to this post (StaticRightAlignBug.html). This page contains further explanation. We have also uploaded a screen-capture of how the test page looks on our system.

    Thanks

    StaticRightAlignBug.html

    Click image for larger version  Name:	StaticRightAlignBug.png Views:	3 Size:	486.3 KB ID:	255998
    Attached Files
    Last edited by DaveC; 27th Nov 2018, 10:00.

  • #2
    What you're seeing here is just different default sizes for different elements. Please see the Form Layout overview for more information.

    Comment


    • #3
      Thanks for the quick reply but I don't think you have understood what our difficulty is. I agree that different kinds of FormItems will correctly lay-out differently but that is not the situation here. My problem is that the same kind of FormItem change how they are aligned when a different DynamicForm .readOnlyDisplay setting is used.
      In particular, FormItems of type="float" or type = "integer", which have canEdit = false, align differently with readOnlyDisplay = "static" compared to readOnlyDisplay = "readOnly". That cannot be correct. Nobody would want that behaviour.
      This causes us quite a big problem because our app design authority wants the readOnlyDisplay = "static" appearance but wants all textAlign="right" *numeric* fields in the form to have the same right alignment. We cannot actually see any way to achieve this very sensible requirement with the current SmartClient. Can one of your engineers adjust our sample to make all the float and integer type fields right-align together correctly?
      I don't believe that we are using these features in an unusual or surprising way. Surely any future application developers who want to right-align read-only and editable numeric fields in a form will hit this same problem?
      NB It looks like FormItem type "float" with canEdit = false and readOnlyDisplay = "static" are being treated just the same as FormItem type = "static"? That can't give the result anyone would want for textAlign = "right" (numeric) fields.
      Thanks

      Comment


      • #4
        See DynamicForm / FormItem.clipStaticValue - set that to true - by default, static text fills the form width, as you can see in your blurb items.
        Last edited by Isomorphic; 28th Nov 2018, 04:48.

        Comment


        • #5
          Many thanks, FormItem.clipStaticValue was the simple answer to our problem.

          It might be a good idea to make this behaviour the default for FloatItem and IntegerItem?

          For anybody finding this thread, we have applied these defaults like this:


          Code:
          isc.TextItem.addClassProperties({
              numericItemDefaults: {
                  textAlign: "right",
                  clipStaticValue: true
              }
          });
          isc.FloatItem.addProperties(isc.TextItem.numericItemDefaults);
          isc.IntegerItem.addProperties(isc.TextItem.numericItemDefaults);

          Comment

          Working...
          X