Standalone - edit on load
Standalone - edit on load
Hi,
I have a table with only one row. There will never be more rows, because it is just a table for settings.
I would like to use the standalone mode with inline or bubble editing.
My goal is, that on page-load the fields are prefilled with the values from row_1 and can be edited.
What do I do wrong? Thanks in advance!
<div class="panel" data-editor-id="row_1">
<dl>
<dt>Jahresstatistik:</dt>
<dd>
<span data-editor-field="c_settings.dashboard_show_hours_year_statistics"></span>
</dd>
<dt>Nicht exp anzeigen:</dt>
<dd data-editor-field="c_settings.dashboard_show_total_hours_not_exported"></dd>
<dt>Office:</dt>
</dl>
</div>
</div>
<!-- Grid Row Main -->
<?php include 'templates/footer.php'; ?>
<script>
var editor;
(function($){
$(document).ready(function() {
editor = new $.fn.dataTable.Editor( {
ajax: "datatables_php/ajax.be_settings_hours.php",
onFieldError: 'focus',
fields: [
{
label: "Dashboard Jahresstatistik:",
name: "c_settings.dashboard_show_hours_year_statistics",
type: 'radio',
options: [
{ label: 'Ja', value: '1' },
{ label: 'Nein', value: '0' }
]
},
{
label: "Dashboard nicht exportierte Stunden",
name: "c_settings.dashboard_show_total_hours_not_exported",
type: 'radio',
options: [
{ label: 'Ja', value: '1' },
{ label: 'Nein', value: '0' }
]
},
]
} ); // EO Editor Instanzierung
$('[data-editor-field]').on( 'click', function (e) {
editor.inline( 'row_1' );
} );
editor.field('c_settings.dashboard_show_hours_year_statistics').input().addClass('form-check-input');
editor.field('c_settings.dashboard_show_total_hours_not_exported').input().addClass('form-check-input');
} ); // EO Doc ready
}(jQuery)); //
</script>
This discussion has been closed.
Answers
I forgot to post the editor - php:
That looks OK. Can you say what the problem is? What is wrong? And are you able to link to your page so we can take a look?
Colin