最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - X-editable prevent the default behavior of input box close on focus out - Stack Overflow

programmeradmin1浏览0评论

How can I prevent the default behavior of closing the x-editable input box when the focus changed to something else?.

My requirement is to keep the input box open until a click on the tick or cross button happens.

How can I prevent the default behavior of closing the x-editable input box when the focus changed to something else?.

My requirement is to keep the input box open until a click on the tick or cross button happens.

Share Improve this question asked Apr 22, 2017 at 9:11 Kanchana RandikaKanchana Randika 5462 gold badges13 silver badges27 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8 +50

I believe you are looking for {onblur: "ignore"}.

From the documentation:

Action when the user clicks outside the container. Can be cancel|submit|ignore.
Setting ignore allows having several containers open.

Please see this fiddle, or the below demo.

$(function() {

  $.fn.editable.defaults.mode = 'inline';
  $('#publicname-change').editable({ onblur:"ignore"})

});
<script src="https://ajax.googleapis./ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn./twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<script src="http://vitalets.github./x-editable/assets/x-editable/bootstrap-editable/js/bootstrap-editable.js"></script>
<link href="http://netdna.bootstrapcdn./twitter-bootstrap/2.2.1/css/bootstrap-bined.min.css" rel="stylesheet"/>
<link href="http://vitalets.github./x-editable/assets/x-editable/bootstrap-editable/css/bootstrap-editable.css" rel="stylesheet"/>


<div class="control-group control-group-inline">
  <div class="controls">
    <a href="#" id="publicname-change" class="editable editable-click inline-input">Mr.Rohith</a>
  </div>
</div>

发布评论

评论列表(0)

  1. 暂无评论