datagrid
datagrid copied to clipboard
Cell edit (small edit) and datepicker
Please add support of custom (etc. bootstrap) datetimepicker (date and datetime) in column edit.
There is a workaround. You should wait on snippet sent. And it's necessary to handle a row used for new records.
//
// It's necessary to set data-my-input attribute in your PHP addInlineEdit() and addInlineAdd() functions
//
// call this code during page initialization
// all inputs having data-my-input are processed
//
$('a[data-datagrid-toggle-inline-add="true"]').click(function () {
// inputs used for new records
$('tr.datagrid-row-inline-add td.datagrid-inline-edit input[data-my-input]').each(function () {
// you can set class or data attributes here
$(this).attr('class', 'any class');
});
});
$.nette.ext('script.datagrid.handling', {
success: function(payload) {
if (payload._datagrid_inline_editing) {
$('td.datagrid-inline-edit input[data-my-input]').each(function () {
// you can set class or data attributes here
$(this).attr('class', 'any class');
});
}
}});
@janmottl It is possible to do it with small edit? Your example is for big editing.
@mabezdek I don't use small editing. So I dion't have experience how to implement it. DataGrid creates textarea inside td element when particular editing starts. So it will be necessary to catch element creation. Edited td has class 'editing' so it can be identified by that.
I sketch just an idea how it could be done. ` $("body").on("DOMNodeInserted", "textarea", function () {
if ($(this).closest("td").hasClass("editing")) {
$(this).addClass("class", "any class"); // set class and attributes you need
}
}); `
Let's keep this issue in scope of data picker. Date time picker is in another issue. Thanks. 👍