Note that there are some explanatory texts on larger screens.

plurals
  1. POSlickGrid's filter input cannot be focused
    text
    copied!<p>I'm making a grid with checkboxes and filtering using SlickGrid examples on GitHub.</p> <p><a href="http://mleibman.github.io/SlickGrid/examples/example-header-row.html" rel="nofollow">Filter example</a></p> <p><a href="http://mleibman.github.io/SlickGrid/examples/example-checkbox-row-select.html" rel="nofollow">Checkboxes example</a></p> <p>Checkbox plugin works fine but I have trouble with header row. I can't select created inputs neither with cursor nor with tabulation. It seems there is nothing in CSS that can block it. Code of the grid:</p> <pre><code>function CreateTestsGrid() { var testGrid; var dataView = new Slick.Data.DataView(); var checkboxSelector = new Slick.CheckboxSelectColumn({ cssClass: "slick-cell-checkboxsel" }); var columns = []; var options = { enableCellNavigation: true, enableColumnReorder: false, multiSelect: true, showHeaderRow: true, headerRowHeight: 50, explicitInitialization: true }; var defaultFormatter = function (row, cell, value, columnDef, dataContext) { return value; } var columnFilters = {}; function filter(item) { for (var columnId in columnFilters) { if (columnId !== undefined &amp;&amp; columnFilters[columnId] !== "") { var c = testGrid.getColumns()[testGrid.getColumnIndex(columnId)]; if (item[c.field] != columnFilters[columnId]) { return false; } } } return true; } return { init: function (parent) { columns.push(checkboxSelector.getColumnDefinition()); //columns.push({ id: "id", name: "id", field: "Id", width: 120, sortable: true }); columns.push({ id: 'Name', name: 'Name', field: 'Name', width: 120 }); columns.push({ id: 'Code', name: 'Code', field: 'Code', width: 120 }); columns.push({ id: 'Mnemonics', name: 'Mnemonics', field: 'Mnemonics', width: 120 }); for (var i in columns) { var col = columns[i]; if (col.formatter == undefined) col.formatter = defaultFormatter; } testGrid = new Slick.Grid(parent, dataView, columns, options); dataView.onRowsChanged.subscribe(function (e, args) { grid.invalidateRows(args.rows); grid.render(); }); $(testGrid.getHeaderRow()).delegate(":input", "change keyup", function (e) { var columnId = $(this).data("columnId"); if (columnId != null) { columnFilters[columnId] = $.trim($(this).val()); dataView.refresh(); } }); testGrid.onHeaderRowCellRendered.subscribe(function (e, args) { $(args.node).empty(); if (args.column.id != '_checkbox_selector') { $('&lt;input type="text"&gt;') .data("columnId", args.column.id) .val(columnFilters[args.column.id]) .appendTo(args.node) } }); testGrid.init(); testGrid.setSelectionModel(new Slick.RowSelectionModel({ selectActiveRow: true })); dataView.syncGridSelection(testGrid, true); testGrid.registerPlugin(checkboxSelector); }, render: function (objects) { if (objects === null) return; dataView.beginUpdate(); dataView.setItems(objects, "Id"); dataView.setFilter(filter); dataView.endUpdate(); var items = dataView.getItems(); testGrid.invalidate(); }, selectedIds: function () { return dataView.mapRowsToIds(testGrid.getSelectedRows()); } } </code></pre> <p>}</p> <p>Grid creating: <code> testsGrid = CreateTestsGrid(); testsGrid.init('#work-list-dialog'); testsGrid.render(tests); </code></p> <p>What am I doing wrong? Please, help me.</p> <p>Update: Oh yes, I started to get it. If I create two equal grids, where one of them created in JQuery.Dialog, then the first one (in dialog) has that problem, and the second one is correct.</p> <p>Update 2: Premshankar Tiwari was definitely right. The problem was in z-index and I just put it incorrect. I found the solution in Google Groups Theme (Ill post link in comments because of my low reputation in SO) and there are so much about that problem. The problem solved.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload