Jump to content

TagField Autocompleted


diegojmap

Recommended Posts

  • 2 weeks later...

For starters, try this approach:

You will use the spacebar to autocomplete.

UniTagField.ClientEvents.UniEvents ->

function beforeInit(sender, config)
{
    config.collapseOnSelect=true;
    sender._val="";
}

UniTagField.ClientEvents.ExtEvents ->

function keypress(sender, e, eOpts)
{
    if (e.event.key == " ") {
        if (sender._val != "") {
            var selValId = sender.store.findRecord("val", sender._val);
            if (selValId) {
                var selValues = sender.getValue();
                selValues.push(selValId.id);
                sender._val = "";
                sender.setValue(selValues);
                sender.blur();
                sender.focus();
            }
        }
    }
    
    if (e.event.key != " ") {
        sender._val += e.event.key; 
    }
}

 

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...