logo
down
shadow

Multiselect Combo box in EXT JS


Multiselect Combo box in EXT JS

By : sscalvo
Date : January 10 2021, 01:49 PM
should help you out Nice one here: http://www.tonylandis.com/code-projects/ext-multiselect-combobox-extension.htm Not sure it works for Extjs 3.X.
There's also this one http://www.technomedia.co.uk/SuperBoxSelect/examples3.html , not so nice but 3.X compatible…
code :


Share : facebook icon twitter icon
How to create multiselect combo

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

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
hop of those help? I have found a solution just after posting this question. However, I guess this must not be part of the "best practices", so, waiting for a better one, here is a good alternative :
code :
Ext.define('MyApp.model.User', {
    ...,
    hasMany: { model: 'Folder', name: 'folders' },
    fields: [..., {
        name: 'folders',
        convert: function (folders) {
            return Ext.Array.map(folders, function (folder) {
                return folder.id;
            });
        }
    }]
});
How to dynamically select values in Multiselect combo box - LovCombo ExtJS 3.2

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

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

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
Related Posts Related Posts :
shadow
Privacy Policy - Terms - Contact Us © 35dp-dentalpractice.co.uk