[4.1][Request] Columns with javascript for inline editing #336
-
Hi, proud to have purchased my first commercial license for backpack (just did) !!! now I'd like to contribute because I need inline edit : did you say you could provide access to 4.0 development to license owners ? otherwise should I work on 3.6 ? will that be compatible with 4.0 ? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
Hi @breizhwave , Glad to hear that :-) Thank you! Access to the 4.0 branch will only be available once it's reasonably stable that you guys can use it inside your projects (even if only on localhost, during development). Until then, I'm afraid there are too many undocumented changes, and using the 4.0 branch would be very frustrating. **Yes, please use the 3.6 branch for now. ** There will be major breaking changes, but I don't expect the upgrade to take more than 30-60min for most projects. But there will definitely be an upgrade process. 3.x projects will be able to move to 4.x. What do you mean by inline editing? Do you mean CRUD columns where you can edit the content with AJAX? Please explain before creating a PR - would help a lot in determining if it's something we can include the the core Backpack project, or more appropriate as a secondary package. Cheers! |
Beta Was this translation helpful? Give feedback.
-
I would love to see support added for switching boolean fields on/off with a click on the column list view. This is similar to inline editing but simpler I guess |
Beta Was this translation helpful? Give feedback.
-
Second what @vesper8 suggest. But for datetime columns that are listed as checkboxes. Checked (Fill with now() value), uncheck (Set to null) |
Beta Was this translation helpful? Give feedback.
-
Note to self: columns with javascript are already possible in v3 and v4. We just have to do the same thing as we did in the {{-- Button Javascript --}}
{{-- - used right away in AJAX operations (ex: List) --}}
{{-- - pushed to the end of the page, after jQuery is loaded, for non-AJAX operations (ex: Show) --}}
@push('after_scripts') @if ($crud->request->ajax()) @endpush @endif
<script>
if (typeof cloneEntry != 'function') {
$("[data-button-type=clone]").unbind('click');
function cloneEntry(button) {
// ask for confirmation before deleting an item
// e.preventDefault();
var button = $(button);
var route = button.attr('data-route');
$.ajax({
url: route,
type: 'POST',
success: function(result) {
// Show an alert with the result
new Noty({
type: "success",
text: "<strong>Entry cloned</strong><br>A new entry has been added, with the same information as this one."
}).show();
// Hide the modal, if any
$('.modal').modal('hide');
if (typeof crud !== 'undefined') {
crud.table.ajax.reload();
}
},
error: function(result) {
// Show an alert with the result
new Noty({
type: "warning",
text: "<strong>Cloning failed</strong><br>The new entry could not be created. Please try again."
}).show();
}
});
}
}
// make it so that the function above is run after each DataTable draw event
// crud.addFunctionToDataTablesDrawEventQueue('cloneEntry');
</script>
@if (!$crud->request->ajax()) @endpush @endif |
Beta Was this translation helpful? Give feedback.
-
I should dev something for a product listing table in one of my client projects. I know Datatable Editor is a paid module but we have also the ability to use BackPack for this ? We should add a property on a field definition like this :
What do you think and which files should be patched to develop it (I could propose a PR if you agree) |
Beta Was this translation helpful? Give feedback.
-
We do have |
Beta Was this translation helpful? Give feedback.
We do have
Editable columns
by now: https://backpackforlaravel.com/products/editable-columns