This is a migrated thread and some comments may be shown as answers.

javascript:resize input element

1 Answer 80 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Murray
Top achievements
Rank 1
Murray asked on 11 Jul 2008, 04:14 AM
This worked in ASP.NET, but can't figure out how to do it in ASP.NET Ajax.
In ASP.NET i did the following:
function SetFilterWidth(uniqueName, columnWidth)
{
    var comboID = filterComboIDs[uniqueName];
    var combo = window[comboID];
    if (combo)
    {
        var comboInput = document.getElementById(combo.InputID);
        var inputWidth = columnWidth - 45;
        comboInput.style.width = inputWidth + "px";           
    }
}
***********************************************************************
In ASP.NET Ajax i tried the following
function SetFilterWidth(uniqueName, columnWidth)
{
    var comboID = filterComboIDs[uniqueName];
    var combo = $find(comboID);
    if (combo)
    {
        var comboInput = combo.get_inputDomElement();
        var inputWidth = columnWidth - 45;
        comboInput.clientWidth = inputWidth + "px";           
    }
}

I get error comboInput.clientWidth is read only.

How do i do this in Ajax version?

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 11 Jul 2008, 10:17 AM
Hello Murray,

If comboInput is a DOM element, you should be able to get a reference to its width using:

comboInput.style.width

If it is a client object, you can try comboInput.get_element().style.width

Greetings,
Veli
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Murray
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or