Announcement

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

    Alignment of float fields in SelectItem

    This issue is not a show stopper, but something I noticed and was wondering if it is intended behavior. Given this example (code can be pasted inside an example window of the feature explorer):

    Code:
    isc.DynamicForm.create({
      fields: [{
        displayField: 'name',
        name: 'example',
        optionDataSource: isc.DataSource.create({
          cacheData: [
            { code: 'y', length: 1.5, name: 'Y', width: 1.5 },
            { code: 'z', length: 1.0, name: 'Z', width: 1.0 }
          ],
          clientOnly: true,
          fields: [
          { name: 'code', primaryKey: true, type: 'text' },
            { format: ',0.00', name: 'length', type: 'float' },
            { name: 'name', type: 'text' },
            { format: ',0.00', name: 'width', type: 'float' }
          ]
        }),
        pickListFields: [
          { name: 'name' },
          { name: 'length' }, // use { name: 'length', type: 'float' } to make the alignment work
          { name: 'width' } // use { name: 'width', type: 'float' } to make the alignment work
        ],
        pickListWidth: 300,
        title: 'Example',
        type: 'select',
        valueField: 'code'
      }]
    });
    This leads to this result:
    Click image for larger version

Name:	not working.png
Views:	87
Size:	6.7 KB
ID:	271260
    I would have expected the Length and Width values to be aligned right (because of the type "float" in the data source for these fields). I set the "format" property in the data source on purpose to demonstrate its settings gets applied in the pick list. As the code suggests, explicitly setting the "type" property in the pick list fields makes the alignment work. If I don't do this and inspect the SelectItem in the browser's console, the type is implicitly set to float. I hope the following image explains what I mean.

    Click image for larger version

Name:	implicit.png
Views:	55
Size:	94.9 KB
ID:	271261

    #2
    Thanks for the notification
    We've made a change to address this issue. Please try the next nightly build dated Nov 10 2023 or above (13.1 and 13.0 branches)

    Regards
    Isomorphic Software

    Comment

    Working...
    X