Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81728

Standalone - edit on load

$
0
0

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>

Viewing all articles
Browse latest Browse all 81728

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>