| eComboBox |
|
eComboBox - a jquery plugin to generate editable ComboBoxes:
simple usage:
$("#cb").eComboBox();
Examplesarrow keys : navigate through combo box
enter key : confirm new or edited element and return to non-editing mode delete key : remove selected element (except {NEW ELEMENT}) Example 1Code: $("#editable").eComboBox();
Example 2Options:allowNewElements : false editableElements : true Code: $("#editable2").eComboBox({
'allowNewElements' : false, // default : true
'editableElements' : true // default : true
});
Example 3Options:allowNewElements : true editableElements : false Code: $("#editable3").eComboBox({
'allowNewElements' : true, // default : true
'editableElements' : false // default : true
});
Buttons to enable/disable options |
Kommentare
I've modified it slightly to allow users to enter {NEW ELEMENT} text as this is not resourced or very none technically orientated. I've also fiddled with the styles to it doesn't use absolute positioning etc so that it works cross browser.
i can e-mail you a copy if you like, just let me know.
I included min.js earlier and cant find inputelement etc.. now i included jquery.eComboBox.js and its working fine in Chrome.
Thanks
Regards,
Krish
The 'change' event uses 'bind' to take all input changes; select-one, radio etc
But with eComboBox under IE9, the e.target.form is null when select-one is changed.
eComboBox event reporting is Ok with Firefox and chrome. Also, a standard select-one is Ok on IE9.
inputElement.blur(function(e ) {
//if(e.keyCode == 13){ //enter
if(selected=="{NEW ELEMENT}" ){
if ($(this).val() != ""){
selectElement.append(
''+$.trim($(this).val())+'');
selectElement.val($(this).val());
}
}else{
if( $(this).val() == "" ) {
selectElement.children( 'option:selected ').remove();
}else{
selectElement.children( 'option:selected ').text($(this).val());
}
}
$(this).hide();
selectElement.focus();
//}
resizeElements( );
});
There is no need to process every keystroke (keyup) since we only want to know when the input is complete (blur).
Help please! Thank you.
Alle Kommentare dieses Beitrages als RSS-Feed.