我有一个可选择的,可导航和可编辑的网格.在单元格中输入值后,我必须更改更新单元格下单元格中的值.要显示两个单元格的更新值,我必须刷新网格.当我这样做时,编辑的单元格失去焦点.我找到了一种在保存事件期间重新聚焦最后编辑的单元格的方法:
save: function (e) {
var focusedCellIndex = this.current()[0].cellIndex; //gets the cell index of the currently focused cell
//...some dataItem saving (dataItem.set()) logic...
this.refresh(); //refreshing the grid instance
setTimeout(function () { //refocusing the cell
return function () {
var focusedCell = $("#grid tr[data-uid='" + dataItem.uid + "'] td:nth-child(" + (focusedCellIndex + 1) + ")");
$('#grid').data('kendoGrid').editCell(focusedCell);
}
}(), 200);
}
Run Code Online (Sandbox Code Playgroud)
问题是这是第一次使用,但是如果我再次尝试重新编辑同一个单元格,则单元格会失去焦点.当我尝试调试时,似乎在第二次尝试中this.current()[0].cellIndex返回0,并且由于该单元格聚焦不再起作用.
有没有人知道为什么this.current()第一次工作,而不是第二次?有没有其他方法重新聚焦细胞?
我在我的项目中使用了selectize.js 0.10.1和Bootstrap 3.0.1.当我在可折叠的Bootstrap面板外面选择组合框时,一切都很有效,如图所示.

工作代码:
<section class="container">
<div class="row" style="margin-bottom: 20px">
<div class="col-lg-4">
<select id="zastoj" placeholder="Razlog zastoja" class="demo-default selectized"></select>
</div>
</div>
</section>
Run Code Online (Sandbox Code Playgroud)
当我在可折叠面板内选择组合框时,组合框无法在点击时打开/展开,看起来它是只读的.

非工作代码:
<section class="container">
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Operacije</h3>
</div>
<div id="collapseOne" class="panel-collapse collapse in">
<div class="panel-body">
<select id="zastoj2" placeholder="Razlog škarta" class="demo-default selectized"></select>
</div>
</div>
</div>
</section>
Run Code Online (Sandbox Code Playgroud)
我当我使用引导2.3.2和0.9 selectize.js在这它的工作小提琴,但我不能让它与引导3.1.1工作,并在此selectize.js 0.9 小提琴.我甚至试过选择0.10.1,但没有运气.
这可以解决,还是某种版本问题?我需要在我的项目中使用Bootstrap 3.0+.
javascript jquery twitter-bootstrap twitter-bootstrap-3 selectize.js