Name
|
Type
|
Default
|
disabled
|
Boolean
|
false
|
Enables or disables the jqxInput.
Code examples
Set the disabled property.
$('#jqxInput').jqxInput({disabled: false });
Get the disabled property.
var disabled = $('#jqxInput').jqxInput('disabled');
|
dropDownWidth
|
Number/String
|
null
|
Sets or gets the jqxInput's dropDown width.
Code examples
Set the dropDownWidth property.
$('#jqxInput').jqxInput({dropDownWidth: 200 });
Get the dropDownWidth property.
var dropDownWidth = $('#jqxInput').jqxInput('dropDownWidth');
|
displayMember
|
String
|
""
|
Sets or gets the displayMember of the Items. The displayMember specifies the name of an object property to display. The name is contained in the collection specified by the 'source' property.
Code example
Set the displayMember property.
$("#jqxInput").jqxInput({displayMember: 'firstName'});
Get the displayMember property.
var displayMember = $('#jqxInput').jqxInput('displayMember');
|
height
|
Number/String
|
null
|
Sets or gets the jqxInput's height.
Code examples
Set the height property.
$('#jqxInput').jqxInput({height: 35 });
Get the height property.
var height = $('#jqxInput').jqxInput('height');
|
items
|
Number
|
8
|
Sets or gets the maximum number of items to display in the popup menu.
Code example
Set the items property.
$("#jqxInput").jqxInput({items: 10 });
Get the items property.
var items = $('#jqxInput').jqxInput('items');
|
minLength
|
Number
|
1
|
Sets or gets the minimum character length needed before triggering auto-complete suggestions.
Code example
Set the minLength property.
$("#jqxInput").jqxInput({minLength: 2 });
Get the minLength property.
var minLength = $('#jqxInput').jqxInput('minLength');
|
maxLength
|
Number
|
null
|
Sets or gets the maximum character length of the input.
Code example
Set the maxLength property.
$("#jqxInput").jqxInput({maxLength: 10 });
Get the maxLength property.
var maxLength = $('#jqxInput').jqxInput('maxLength');
|
opened
|
Boolean
|
false
|
Sets or gets a value indicating whether the auto-suggest popup is opened.
Code example
Set the opened property.
$('#jqxInput').jqxInput({opened : true});
Get the opened property.
var opened = $('#jqxInput').jqxInput('opened');
|
placeHolder
|
String
|
""
|
Sets or gets the input's place holder.
Code example
Set the placeHolder property.
$("#jqxInput").jqxInput({placeHolder: "Enter text" });
Get the placeHolder property.
var placeHolder = $('#jqxInput').jqxInput('placeHolder');
|
popupZIndex
|
Number
|
20000
|
Sets or gets the auto-suggest popup's z-index.
Code example
Set the popupZIndex property.
$("#jqxInput").jqxInput({popupZIndex: 999999});
Get the popupZIndex property.
var zIndex = $('#jqxInput').jqxInput('popupZIndex');
|
query
|
String
|
""
|
Determines the input's query.
Code example
Set the query property.
$("#jqxInput").jqxInput({query: "un" });
Get the query property.
var query = $("#jqxInput").jqxInput('query');
|
renderer
|
function
|
null
|
Enables you to update the input's value, after a selection from the auto-complete popup.
Code example
Set the renderer property.
var countries = new Array("Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burma", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombia", "Comoros", "Congo, Democratic Republic", "Congo, Republic of the", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Greece", "Greenland", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Mongolia", "Morocco", "Monaco", "Mozambique", "Namibia", "Nauru", "Nepal", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Samoa", "San Marino", " Sao Tome", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe");
$("#jqxInput").jqxInput({ placeHolder: "Enter a Country", height: 25, width: 250,
source: function (query, response) {
var item = query.split(/,\s*/).pop();
// update the search query.
$("#jqxInput").jqxInput({ query: item });
response(countries);
},
renderer: function (itemValue, inputValue) {
var terms = inputValue.split(/,\s*/);
// remove the current input
terms.pop();
// add the selected item
terms.push(itemValue);
// add placeholder to get the comma-and-space at the end
terms.push("");
var value = terms.join(", ");
return value;
}
});
|
rtl
|
Boolean
|
false
|
Sets or gets a value indicating whether widget's elements are aligned to support locales using right-to-left fonts.
Code example
Set the rtl property.
$('#jqxInput').jqxInput({rtl : true});
Get the rtl property.
var rtl = $('#jqxInput').jqxInput('rtl');
|
searchMode
|
String
|
'default'
|
Sets or gets the search mode. When the user types into the edit field,
the jqxInput widget tries to find the searched item using the entered text and the selected search mode.
Possible Values:
'none'
'contains'
'containsignorecase'
'equals'
'equalsignorecase'
'startswithignorecase'
'startswith'
'endswithignorecase'
'endswith'
Code example
Set the searchMode property .
$("#jqxInput").jqxInput({searchMode: 'contains' });
Get the searchMode property.
var searchMode = $('#jqxInput').jqxInput('searchMode');
|
source
|
Array, function
|
[]
|
Sets the widget's data source. The 'source' function is passed two arguments, the input field's value and a callback function. The 'source' function may be used synchronously by returning an array of items or asynchronously via the callback.
Code example
Initialize a jqxInput with the source property specified.
var countries = new Array("Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burma", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombia", "Comoros", "Congo, Democratic Republic", "Congo, Republic of the", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Greece", "Greenland", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Mongolia", "Morocco", "Monaco", "Mozambique", "Namibia", "Nauru", "Nepal", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Samoa", "San Marino", " Sao Tome", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe");
$("#input").jqxInput({placeHolder: "Enter a Country", height: 25, width: 200, minLength: 1, source: countries });
|
theme
|
String
|
''
|
Sets the widget's theme.
jQWidgets uses a pair of css files - jqx.base.css and jqx.[theme name].css. The base stylesheet creates the styles related to the widget's layout like margin, padding, border-width, position. The second css file applies the widget's colors and backgrounds. The jqx.base.css should be included before the second CSS file.
In order to set a theme, you need to do the following:
|
valueMember
|
String
|
""
|
Sets or gets the valueMember of the Items. The valueMember specifies the name of an object property to set as a 'value' of the list items. The name is contained in the collection specified by the 'source' property.
Code example
Set the valueMember property.
$("#jqxInput").jqxInput({valueMember: 'lastName'});
Get the valueMember property.
var valueMember = $('#jqxInput').jqxInput('valueMember');
|
width
|
Number/String
|
null
|
Sets or gets the jqxInput's width.
Code examples
Set the width property.
$('#jqxInput').jqxInput({width: 200 });
Get the width property.
var width = $('#jqxInput').jqxInput('width');
|
|
change
|
Event
|
|
This event is triggered when the value is changed.
Code examples
Bind to the change event by type: jqxInput.
$('#jqxInput').on('change',
function (event)
{
var value = $('#jqxInput').val();
// type
var type = event.args.type; // keyboard, mouse or null depending on how the value was changed.
});
|
close
|
Event
|
|
This event is triggered when the auto-suggest popup is closed.
Code examples
Bind to the close event by type: jqxInput.
$('#jqxInput').on('close',
function(){ // type your code here. });
|
open
|
Event
|
|
This event is triggered when the auto-suggest popup is opened.
Code examples
Bind to the select event by type: jqxInput.
$('#jqxInput').on('open',
function(){ // type your code here. });
|
select
|
Event
|
|
This event is triggered when an item is selected from the auto-suggest popup.
Code examples
Bind to the select event by type: jqxInput.
$('#jqxInput').on('select',
function () { var value = $('#jqxInput').val(); });
|
|
destroy
|
Method
|
|
Destroys the widget.
Parameter |
Type |
Description |
None |
|
|
Return Value
None
Code examples
Invoke the destroy method.
$('#jqxInput').jqxInput('destroy');
|
focus
|
Method
|
|
Focuses the widget.
Parameter |
Type |
Description |
None |
|
|
Return Value
None
Code examples
Invoke the focus method.
$('#jqxInput').jqxInput('focus');
|
selectAll
|
Method
|
|
Selects the text in the input field.
Parameter |
Type |
Description |
None |
|
|
Return Value
None
Code examples
Invoke the selectAll method.
$('#jqxInput').jqxInput('selectAll');
|
val
|
Method
|
|
Sets or gets the value.
Parameter |
Type |
Description |
value |
String |
|
Return Value
String
Code examples
Get the value :
var value = $('#jqxInput').jqxInput('val'); or var value = $('#jqxInput').val();
Set the value :
$('#jqxInput').jqxInput('val', 'New Value'); or $('#jqxInput').val('New Value');
$('#jqxInput').jqxInput('val', {label: "Item 1", value: "1"});
|