How to create multiselect combo
By : Mathieu
Date : March 29 2020, 07:55 AM
this will help In your cell renderer, you are assuming a index of 0 is the selected value, it's not. It's actually -1 (or more precisely, that's the index used to represent the value of the editor) code :
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
setFont(list.getFont());
if (index == -1 && selectionManager.getSelectedItems().size() > 0) {
StringBuffer firstItem = new StringBuffer();
for (Object sel : selectionManager.getSelectedItems()) {
firstItem.append(sel + "; ");
}
if (firstItem.toString().endsWith("; ")) {
firstItem.deleteCharAt(firstItem.length() - 2);
}
setText((value == null) ? "" : firstItem.toString());
} else {// other items
setText((value == null) ? "" : value.toString());
}
return this;
}
|
Load nested models in a form containing a combo multiSelect=true in ExtJS 4.1.1
By : zerocool
Date : March 29 2020, 07:55 AM
|
How to dynamically select values in Multiselect combo box - LovCombo ExtJS 3.2
By : user5966026
Date : March 29 2020, 07:55 AM
this will help in record's field definition you can create a new field called checked, this field is by default used by lovcombo to store checked state of the record code :
fields: [
...
{name: 'checked', type: 'boolean'},
....
]
record.set('checked', true);
|
How to get focus for selected values when multiselect combo is used
By : Furkat Karaev
Date : March 29 2020, 07:55 AM
wish of those help I'm using a multiselect combobox, i select few values from the combobox and save the selected values to db. when i reopen the page, i need the focus to be placed on the values which was selected and saved. , To set the focus with javascript you can use code :
document.getElementById("309127").focus();
<html>
<body onload="load()">
<select id="example">
<option value="one"> one </option>
<option value="two"> two </option>
<option value="three"> three </option>
</select>
</body>
<script>
function load(){
var param1 = getParameterByName("param1");
var selected = document.getElementById('example');
var opts = selected.options.length;
for (var i=0; i<opts; i++){
if (selected.options[i].value == param1){
selected.options[i].selected = true;
break;
}
}
}
function getParameterByName(name)
{
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.search);
if(results == null)
return "";
else
return decodeURIComponent(results[1].replace(/\+/g, " "));
}
</script>
</html>
|
Force the store to load only those values which are not selected inside Multiselect combo selection-EXTJS
By : user1816922
Date : March 29 2020, 07:55 AM
Hope that helps I'm using EXTJs 3.4 and I have an issue around loading the multi combo values, ON EDIT page I want to check what values have been selected inside a multiselect and not load those values in the dropdown options. , Steps
|