当前位置: 动力学知识库 > 问答 > 编程问答 >

jquery - semantic ui customize allowAdditions message

问题描述:

Is there a possibility to customize the message of dropdown allowAdditions?

By default is just "add". But I want to give the user some template for the input, like "add (first and last name):".

 $('.ui.dropdown').dropdown('setting', {

allowAdditions: true,

action: 'combo'

});

Here is a fiddle https://jsfiddle.net/xnjfzpw5/

Any help with this? Thanks in advance.

网友答案:

semantic.js defines several default messages. You may search the library for "message: {" ;-)

To customize the message , you could override the default message. But actually better to use the settings, like:

$('.ui.dropdown').dropdown('setting', {
    allowAdditions: true,
    message: {addResult:'Here your customized message: <b>{term}</b>'},
    action: 'combo'
  });

See the modified fiddle and have a nice day!

分享给朋友:
您可能感兴趣的文章:
随机阅读: