Trước khi di chuyển lưới kendo-ui của tôi bên trong một phương thức bootstrap tôi sẽ nhấp vào Add Row và đầu tiên của 3 đầu vào sẽ được chọn. Sau đó tôi sẽ chuyển sang tab thứ 2, sau đó là 3 và sau đó đến nút hộp kiểm nơi tôi sẽ nhấn enter và hàng sẽ được thêm vào. Sau đó, tiêu điểm sẽ quay trở lại nút Thêm hàng vào nơi tôi có thể nhấn enter để bắt đầu lại quá trình. Vâng, bây giờ nó là bên trong một phương thức tôi mất tất cả mọi thứ ngoại trừ tabbing. Tôi đã tìm thấy các giải pháp sử dụng jquery để áp dụng tiêu điểm nhưng tôi đã có điều đó bên trong bộ điều khiển lưới của tôi.làm thế nào để thiết lập đầu vào tập trung vào đầu vào lưới kendo-ui bên trong bootstrap phương thức
Kendo-ui điều khiển lưới
$scope.mainGridOptions = {
dataSource: dataSource,
pageable: false,
toolbar: [{ name: "create", text: "Add Product", }],
columns: [
{ field: "product", title: "Product", width: "95px", editor: productEditor },
{
field: "price", title: "Price", width: "95px", format: "{0:c2}", editor: priceEditor
},
{
field: "sqft", title: "Square Feet", width: "95px", editor: sqftEditor
},
{
command: [{ name: 'edit', text: { edit: '', update: '', cancel: '' }, width: '20px' }, { name: 'destroy', text: '' }], title: ' ', width: '80px'
}],
editable: 'inline'
};
function productEditor(container, options) {
$('<input id="product" name="product" data-bind="value:product" data-productvalidation-msg="Put the Product!" />')
.appendTo(container)
.kendoMaskedTextBox({});
$("#product").focus(function() {
var input = $(this);
setTimeout(function() {
input.select();
});
});
};
function priceEditor(container, options) {
$('<input id="price" name="price" data-bind="value:price" data-step="10000" style="" data-productvalidation-msg="Put the Price!"/>')
.appendTo(container)
.kendoNumericTextBox({ format: 'c0', min: 0 });
$("#price").focus(function() {
var input = $(this);
setTimeout(function() {
input.select();
});
});
}
function sqftEditor(container, options) {
$('<input id="sqft" name="sqft" data-bind="value:sqft" data-step="500" style="" data-productvalidation-msg="Put the Sqft!"/>')
.appendTo(container)
.kendoNumericTextBox({ format: '0', min: 0 });
$("#sqft").focus(function() {
var input = $(this);
setTimeout(function() {
input.select();
});
});
};
Modal
<!-- Grid Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<div style="width:100%"><span class="modal-label">My Product Data</span><button style="float:right" class="btn btn-custom waves-effect" data-dismiss="modal"><i class="zmdi zmdi-close"></i></button></div>
</div>
<div class="modal-body">
<div kendo-grid id="grid" options="mainGridOptions"></div>
</div>
</div>
</div>
</div><!--End Grid Modal -->
Chức năng để mở modal
$scope.openGrid = function() {
$('#myModal').modal('show');
};
Thử loại bỏ thuộc tính đánh dấu trợ giúp ['role = document'] (http://www.w3.org/TR/wai-aria/roles#document) để xem đó có phải là wh đang gây ra vấn đề. ['vai trò = ứng dụng'] (http: //www.w3.ứng dụng org/TR/wai-aria/roles #) có thể phù hợp hơn. – Andrew