Announcement

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

    RadioGroupItem height + patch

    Hi,

    I've found a problem calculating height of RadioGroupItem, in fact there are two problems.

    1. Height of horizontal items -> it was calculated as of vertical ones

    2. Cellpadding of ContainerItem was not correctly added so there is a problem with exact aligning of DynamicForm.

    Both problems resulted in larger height of DynamicForm leaving gap below all items.

    I've created a patch in JavaScript that solves the problem.
    Code:
    isc.RadioGroupItem.addMethods({
        	getHeight : function () {
        		[b]var cellPadding = isc.isA.Number(this.cellPadding) ? this.cellPadding : 0;
        		if(!this.vertical) return this.itemHeight + cellPadding * 2;[/b]
                var valueMap = this.getValueMap(),
                    numItems = 0;
    
                // if valueMap is an array, number of items is just the length of the array
                if (isc.isAn.Array(valueMap)) {
                    numItems = valueMap.length;
                } else {
                    for (var key in valueMap) {
                        numItems++;
                    }
                }
                return numItems * (this.itemHeight [b]+ cellPadding * 2)[/b];
            }
    });
    I've highlighted changes from original source RadioGroupItem.js

    Before I've worked this out by setCellHeight() but latest browsers cellpadding problem wasn't solved that way.

    Hope that I can add this patch to source.

    Best regards
    Mariusz Goch
    Last edited by pH4Lk0n; 2 Feb 2013, 16:08. Reason: CellPadding not from DynamicForm but ContainerItem

    #2
    Thank you for this patch code. This looks correct and we are incorporating it into the source as requested.

    This will be added to the development branch (4.0d) today, so will be present in nightly builds going forward

    Regards
    Isomorphic Software

    Comment

    Working...
    X