在将kendo-ui网格移动到自举模式之前,我将点击添加行,并选择3个输入中的第一个.然后我会选择到第二,然后第三,然后选项卡到复选框按钮,我会按Enter,行将被添加.然后焦点将返回到添加行按钮,我可以按Enter键重新开始处理.现在,这是一个模态,我失去了一切,除了tabbing.我已经找到了使用
jquery应用焦点的解决方案,但是我已经在网格控制器里面了.
Kendo-ui电网控制器
$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",format: "{0:c2}",editor: priceEditor },{ field: "sqft",title: "Square Feet",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(); }); }); };
语气
<!-- 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 -->
功能打开模式
$scope.openGrid = function () { $('#myModal').modal('show'); };