Skip to main content
A newer version of this page is available. .

ASPxClientHint.UpdatePosition Method

Forces the hint to recalculate its position.

Declaration

static UpdatePosition(
    hintElementOrTargetElement?: any
): void

Parameters

Name Type Description
hintElementOrTargetElement any

An object that is the hint element or the target element.

Remarks

When the hint is going to be shown, it calculates its size and chooses the best position at which to appear. The hint’s size primarily depends on the hint’s content. In most cases, the hint content is known before the hint calculates its window’s size. This requires no extra manipulations. The hint calculates its size before the content is ready (for example, when the content is obtained via AJAX request). In this case, the hint can’t calculate the correct window size and position. To recalculate the position, use the UpdatePosition method.

ASPxClientHint.Register('[data-visibleindex]', {
    onShowing: function(s, e) {
        var index = getElementAttr(e.targetElement);
        var key = Grid.GetRowKey(index);
        Grid.GetRowValues(index, 'Notes', function(content) {
            e.contentElement.innerHTML = '<div class="hintContent">' +
              '<img src="LoadContentOnDemand.aspx?photo=' + key + '" />' +
              content +'</div>';
        ASPxClientHint.UpdatePosition(e.hintElement);
        });
    return 'loading...';
    },
    position: 'left',
    triggerAction: 'click'
});
See Also