ArticleDirectory
- Cancelpostback
- Datatextfield
- Datavaluefield
- Editable
- Element
- Events
- Expandeffects
- ID
- Needpostback
- Getdisplayvalue ()
- Getdropdown ()
- Getgrid ()
- Getselectedindex ()
- Getvisible ()
- Getactivecell
- Setactivecell
All the controls in netadvantage have client object models, which are easy to find for ultrawebgrid and are not easy to find for webcombo. They are now posted for reference, if you want to control the console of the drop-down grid in webcombo, you can use the getgrid () method to obtain the Grid Object. This object is actually the ultrawebgrid object, for more information about the client model, see the ultrawebgrid model.
The client Object Model of netadvantage webcombo is as follows:
The combo object of ultrawebcombo can be obtained within the page usingIgcmbo_getcombobyid
Utility Function.
VaR combo = igcmbo_getcombobyid ('ultrawebcombo1 ');
The combo can also be referenced directly through the definition that is automatically generated for it. if the name of the combo on the server is 'ultrawebcombo1' then a variable called oultrawebcombo1 will be available from anywhere within the page. the 'O' prefix is a convention used to indicate that the variable is an object as opposed to an HTML element. when a variable represents an HTML element, an 'E' is prefixed in front of it.
This topic also contains the following sections:
Propertiescancelpostback
Gets or sets a Boolean value that indicates whether PostBack shocould be canceled when the next event occurs. if a PostBack is set to occur due to some other client-side activity, setting this property to true will prevent the PostBack from occurring. this property can be changed on the client.
VaR combo = igcmbo_getcombobyid ('ultrawebcombo1 ');
Combo. cancelpostback = true;
Datatextfield
Identifies the column key value used as the source of display text in the top portion of the webcombo. this property corresponds to the property of the same name on the server. this property is read-only and shocould not be changed on the client.
Datavaluefield
Identifies the column key value used as the source of data values posted back to the server for webcombo. this property corresponds to the property of the same name on the server. this property is read-only and shocould not be changed on the client.
Editable
Returns a Boolean value that indicates whether or not the webcombo element is editable in the top portion of the element. if true, the user can enter their own values in the combo, if false they user is restricted to selecting values already present in the dropdown. this property corresponds to the property of the same name on the server. this property is read-only and shocould not be changed on the client.
VaR combo = igcmbo_getcombobyid ('ultrawebcombo1 ');
VaR canbeedited = combo. editable;
Element
Returns the HTML Element Object corresponding to the webcombo on the page. This property is read-only and shocould not be changed.
VaR element = igcmbo_getcombobyid ('webcombo1'). element; element. style. color = "red ";
Events
See belowEvents.
Expandeffects
This property returns an object that contains the values set for the expand effects that will be supplied when webcombo is dropped down. for more detail, see the expandeffects object topic. the expandeffects object contains the same properties as the server-side version. this object corresponds to the property of the same name on the server.
VaR expfx = igcmbo_getcombobyid ('webcombo1'). expandeffects; expfx. Duration = 100;
Expfx. Opacity = 70;
ID
Returns the html id property of the top-level webcombo element on the page. This property is read-only and shocould not be changed.
VaR id = oultrawebcombo1.id;
Needpostback
Gets or sets a Boolean value that indicates whether a PostBack shoshould be initiated after the following event occurs. set this property to true to force a manual PostBack to occur after the next event. this property can be changed on the client.
Owebcombo. needpostback = true;
Methodsgetdisplayvalue ()
Returns the current value of the top portion of the webcombo element.
VaR value = ocombo. getdisplayvalue ();
Getdropdown ()
Returns a Boolean value that indicates whether or not the webcombo dropdown is currently displayed.
If (ocombo. getdropdown () return; else ocombo. setdropdown (true );
Getgrid ()
Returns a reference to the ogrid object that manages the dropdown area of the webcombo element. This object supports the entire object and programming model of the webgrid element on the client.
VaR ogrid = ocombo. getgrid ();// Turn off sorting in the dropdown
Ogrid. allowsort = 2;
Getselectedindex ()
Returns the index offset of the currently selected row of the dropdown grid.
VaR Index = ocombo. getselectedindex ();
Getvisible ()
Returns a Boolean value that indicates whether or not the webcombo element is visible on the page.
VaR visible = ocombo. getvisible (); If (! Visible) ocombo. setvisible (true );
Setdisplayvalue (
Newvalue ,
Bfireevent )
Sets the value and the text in the top portion of the webcombo element to the passed inNewvalueParameter. The second parameter,Bfireevent, Is a Boolean value that indicates whetherBeforeselectchangeAndAfterselectchangeEvents shoshould be fired on the client.
Parameters:
Newvalue-A string value that will be assigned to the element.
Bfireevent-A boolean value that specifies whether
BeforeselectchangeAnd
AfterselectchangeClient-side events shocould be fired. If true, the events will occur.
Ocombo. setdisplayvalue ("John Doe", true );
Setdropdown (
Bdrop )
This method controls the dropdown state of webcombo. Passing true as a parameter causes the dropdown to display if it is not already displayed. Passing false causes the dropdown to dissappear if it is visible.
Parameters:
Bdrop-A boolean value that specifies the dropped-down state of the element.
Ocombo. setdropdown (true );
Setvisible (
Bvisible )
Sets the visiblity of the webcombo according to the passed-in Boolean value. If true, the webcombo element is displayed at its current position. If false, the webcombo element is hidden on the page.
Parameters:
Bvisible-A boolean value that specifies the visibility of the webcombo element.
Ocombo. setvisible (false );
Setwidth (
Width )
Sets the width of the webcombo element in pixels.
Parameters:
Width-An integer value that specifies the width of the element.
Ocombo. setwidth (150 );
Events
TheEventsObject contains over 25 members that are used to specify JavaScript function handlers that are called in response to a variety of events occurring on the client.EventMember is only populated with a valid JavaScript function if the function name is set fromEventsObject ofDisplaylayoutObject on the server.
All events are called with at least one parameter: the ID of the webcombo on which the event occurred. In the case ofEditkeydownAndEditkeyupEvents, additional parameters are added which specify thecurrent or new value for the edit portion of the combo, And the keycode of the keystroke that caused the event.
The members ofEventsObject are:
- Aftercloseup (ID)
- Afterdropdown (ID)
- Afterselectchange (ID)
- Beforecloseup (ID)
- Beforedropdown (ID)
- Beforeselectchange (ID)
- Editkeydown (ID, currentvalue, keycode)
- Editkeyup (ID, newvalue, keycode)
- Initializecombo (ID)