Apr 02, 2011, 6:54 PM
[CLOSED] ComboBox - How do I expand a ComboBox in Javascript?
I have a little bit of a problem understanding how you reference Controls in Javascript.
If I have a Javascript-function without any parameters it seems like "this" references the Control that the listener who fired the event is attached to.
So if I have a JS-function like this:
But if the JS-function looks like this:
I'd appreciate a few words on this =)
Thx.
If I have a Javascript-function without any parameters it seems like "this" references the Control that the listener who fired the event is attached to.
So if I have a JS-function like this:
function checkValueArea() {
var id = this.getValue();
}
that gets called from a ComboBox like this:<ext:ComboBox runat="server" EmptyText="Inget område valt"
ID="Field_Address_ComboBox_Area">
<Store>
<ext:Store ID="Field_Address_Store_Area" runat="server" AutoLoad="false" OnRefreshData="Field_Address_Store_Area_Refresh">
<Proxy>
<ext:PageProxy />
</Proxy>
<Reader>
<ext:ArrayReader>
<Fields>
<ext:RecordField Name="AreaId" />
<ext:RecordField Name="AreaName" />
</Fields>
</ext:ArrayReader>
</Reader>
</ext:Store>
</Store>
<Listeners>
<Blur Fn="checkValueArea" />
</Listeners>
</ext:ComboBox>
i get the correct value in "id". But if the JS-function looks like this:
function checkValueArea(testVar) {
var id = this.getValue();
}
I get an javascript error saying that
Uncaught TypeError: Object [object DOMWindow] has no method 'getValue'
Thx.
Last edited by Daniil; Apr 04, 2011 at 9:01 AM.
Reason: [CLOSED]