{"id":651,"date":"2022-08-30T15:04:54","date_gmt":"2022-08-30T15:04:54","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/how-to-change-default-options-in-jquery-mentionsinput-jquery-plugin-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:04:54","modified_gmt":"2022-08-30T15:04:54","slug":"how-to-change-default-options-in-jquery-mentionsinput-jquery-plugin-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/how-to-change-default-options-in-jquery-mentionsinput-jquery-plugin-collection-of-common-programming-errors\/","title":{"rendered":"How to change default options in jquery.mentionsInput (jquery plugin)?-Collection of common programming errors"},"content":{"rendered":"<p>How to change default options in jquery.mentionsInput (jquery plugin)<\/p>\n<pre><code>(function ($, _, undefined) {\n\n  \/\/ Settings\n  var defaultSettings = {\n    triggerChar   : '@',\n    onDataRequest : $.noop,\n    minChars      : 2,\n    showAvatars   : true,\n    elastic       : true,\n    classes       : {\n      autoCompleteItemActive : \"active\"\n    },\n    templates     : {\n      wrapper                    : _.template(''),\n      autocompleteList           : _.template('')\n    }\n  };\n....\n<\/code><\/pre>\n<p>How to set an other triggerChar value from<\/p>\n<pre><code>  $('textarea.mention, input.mention').mentionsInput({\n\n    onDataRequest:function (mode, query, callback) {\n      var data = [\n        { id:1, name:'Kenneth Auchenberg', 'avatar':'http:\/\/cdn0.4dots.com\/i\/customavatars\/avatar7112_1.gif', 'type':'contact' }\n      ];\n    }\n  });\n<\/code><\/pre>\n<ol>\n<li>\n<p>From the docs you set <code>triggerChar<\/code> e.g.<\/p>\n<pre><code>$('textarea.mention, input.mention').mentionsInput({\n\n  onDataRequest: function(){},\n  triggerChar: '#'\n});\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-09 21:10:40. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>How to change default options in jquery.mentionsInput (jquery plugin) (function ($, _, undefined) { \/\/ Settings var defaultSettings = { triggerChar : &#8216;@&#8217;, onDataRequest : $.noop, minChars : 2, showAvatars : true, elastic : true, classes : { autoCompleteItemActive : &#8220;active&#8221; }, templates : { wrapper : _.template(&#8221;), autocompleteList : _.template(&#8221;) } }; &#8230;. How [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-651","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/651","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=651"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/651\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=651"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=651"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=651"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}