{"id":7807,"date":"2015-10-28T05:53:14","date_gmt":"2015-10-28T05:53:14","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/10\/28\/bootstrap-x-editable-use-div-ajax-or-function-to-load-custom-type-editor-open-source-projects-vitalets-x-editable\/"},"modified":"2015-10-28T05:53:14","modified_gmt":"2015-10-28T05:53:14","slug":"bootstrap-x-editable-use-div-ajax-or-function-to-load-custom-type-editor-open-source-projects-vitalets-x-editable","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/10\/28\/bootstrap-x-editable-use-div-ajax-or-function-to-load-custom-type-editor-open-source-projects-vitalets-x-editable\/","title":{"rendered":"Bootstrap X-editable &#8211; use div, ajax or function to load custom type editor?-open source projects vitalets\/x-editable"},"content":{"rendered":"<p>I&#8217;m using Bootstrap 3 with X-editable ( http:\/\/vitalets.github.io\/bootstrap-editable\/ )<\/p>\n<p>I require a variety of custom type editors. It&#8217;s impractical to implement them as string templates as indicated in the sample code:<\/p>\n<pre><code>         callOrQuoteEditor.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, {\n             tpl: '' +\n                     '' +\n                     '' +\n                     '  call' +\n                     '  quote' +\n                     '' +\n                     ' within ' +\n                     '' +\n                     '' +\n                     '  minute(s)' +\n                     '  hour(s)' +\n                     '  day(s)' +\n                    '' +\n                    '' +\n                 '',\n\n            inputclass: ''\n        });\n<\/code><\/pre>\n<p>Rather I would like to do one of the following:<\/p>\n<p>1) Load the template using an AJAX loaded form<\/p>\n<p>2) Load the template from an existing, hidden<\/p>\n<p>3) Load the template from a function call, from which I can return whatever I like<\/p>\n<p>I cannot find any way in the documentation or sample code to do this.<\/p>\n<p>Short of hacking bootstrap-editable.js script, what can I do?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m using Bootstrap 3 with X-editable ( http:\/\/vitalets.github.io\/bootstrap-editable\/ ) I require a variety of custom type editors. It&#8217;s impractical to implement them as string templates as indicated in the sample code: callOrQuoteEditor.defaults = $.extend({}, $.fn.editabletypes.abstractinput.defaults, { tpl: &#8221; + &#8221; + &#8221; + &#8216; call&#8217; + &#8216; quote&#8217; + &#8221; + &#8216; within &#8216; + [&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-7807","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7807","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=7807"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7807\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7807"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7807"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7807"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}