Master - Detail
Master - Detail

Not working ! Whats wrong ?
bizonylat.html
<div class="container">
<h1>
Számlák <span>bizonylat</span>
</h1>
<table cellpadding="0" cellspacing="0" border="0" class="display" id="bizonylatszamla" width="100%">
<thead>
<tr>
<th>Számlaszám</th>
<th>Számlakelt.</th>
</tr>
</thead>
</table>
<table cellpadding="0" cellspacing="0" border="0" class="display" id="tetelekszamla" width="100%">
<thead>
<tr>
<th>Számlaszám</th>
<th>Mennyiség</th>
</tr>
</thead>
</table>
</div>
bizonylatszamla.php
<?php
/*
* Editor server script for DB table torzsbank
* Created by http://editor.datatables.net/generator
*/
// DataTables PHP library and database connection
include( "lib/DataTables.php" );
// Alias Editor classes so they are easy to use
use
DataTables\Editor,
DataTables\Editor\Field,
DataTables\Editor\Format,
DataTables\Editor\Mjoin,
DataTables\Editor\Options,
DataTables\Editor\Upload,
DataTables\Editor\Validate,
DataTables\Editor\ValidateOptions;
// The following statement can be removed after the first run (i.e. the database
// table has been created). It is a good idea to do this to help improve
// performance.
$db->sql( "CREATE TABLE IF NOT EXISTS `bizonylatszamla` (
`szlaid` int(10) NOT NULL auto_increment,
`szamlaszam` varchar(30),
`szamlakelt` date,
PRIMARY KEY( `szlaid` )
);" );
// Build our Editor instance and process the data coming from _POST
Editor::inst( $db, 'bizonylatszamla', 'szlaid' )
->fields(
Field::inst( 'szlaid' )->set( false ),
Field::inst( 'szamlaszam' )->validator( 'Validate::notEmpty' ),
Field::inst( 'szamlakelt' )
)
->join(
Mjoin::inst( 'tetelekszamla' )
->link( 'bizonylatszamla.szlaid', 'tetelekszamla.szlaid' )
->fields(
Field::inst( 'szlaid' )
)
)
->process( $_POST )
->json();
bizonylatszamla.js
/*
* Editor client script for DB table torzsbank
* Created by http://editor.datatables.net/generator
*/
(function($){
$(document).ready(function() {
var bizonylatszamlaeditor = new $.fn.dataTable.Editor( {
ajax: 'php/table.bizonylatszamla.php',
table: '#bizonylatszamla',
fields: [
{
"label": "Számlaszám:",
"name": "szamlaszam"
},
{
"label": "Számlakelt:",
"name": "szamlakelt"
}
],
i18n: {
create: {
button: "Új",
title: "Új bejegyzés létrehozása",
submit: "Rögzít"
},
edit: {
button: "Módosít",
title: "Bejegyzés szerkesztése",
submit: "Rögzít"
},
remove: {
button: "Töröl",
title: "Eltávolítás",
submit: "Eltávolít",
confirm: {
_: "Biztosan törölni szeretné a(z)%d sort?",
1: "Biztosan törölni szeretne 1 sort?"
}
},
error: {
system: "Hiba történt, forduljon a rendszergazdához"
},
datetime: {
previous: 'Előző',
next: 'Következő',
months: [ 'Január', 'Február', 'Március', 'Április', 'Május', 'Június', 'Július', 'Augusztus', 'Szeptember', 'Október', 'November', 'December' ],
weekdays: [ 'Hétfő', 'Kedd', 'Szerda', 'Csütörtök', 'Péntek', 'Szombat', 'Vasárnap' ]
}
}
} );
var bizonylatszamlatable = $('#bizonylatszamla').DataTable( {
dom: 'Bfrtip',
ajax: 'php/table.bizonylatszamla.php',
columns: [
{
"data": "szamlaszam"
},
{
"data": "szamlakelt"
}
],
select: true,
lengthChange: false,
buttons: [
{ extend: 'create', editor: bizonylatszamlaeditor },
{ extend: 'edit', editor: bizonylatszamlaeditor },
{ extend: 'remove', editor: bizonylatszamlaeditor }
],
language: {
processing: "Feldolgozás folyamatban...",
search: "Keresés:",
lengthMenu: "Elemek _MENU_ megjelenítése",
info: "Megjelenítve _START_ től _END_ , _TOTAL_ összesen",
infoEmpty: "Megejelenítve 0 től 0 től , 0 összesen",
infoFiltered: "(Szűrés _MAX_ összesen elem)",
infoPostFix: "",
loadingRecords: "Betöltés...",
zeroRecords: "Nincs találat",
emptyTable: "Nincs adat a táblázatban",
paginate: {
first: "Első",
previous: "Előző",
next: "Következő",
last: "Utolsó"
},
aria: {
sortAscending: ": aktiválja, hogy az oszlopot növekvő sorrendben rendezze",
sortDescending: ": aktiválja az oszlop rendezéséhez csökkenő sorrendben"
}
}
} );
} );
}(jQuery));
This discussion has been closed.
Answers
tetelekszamla.php
tetelekszamla.js
Thats a lot of code to look through without know what the problem is. Maybe you can start by providing details of what is not working and if you are getting any alert or console log errors. Better yet please provide a link to your page or a test case replicating the issue along with steps to see the problem.
Kevin
programozas.org/zeusz/production/bizonylat-szamla.html
The detail not working in this link...
Can you help us to help you, please. What isn't working? How can we reproduce the issue?
You press the bottom new button, enter the account number for example: 2019/1 enter the quantity for example: 1 press the capture button and then the event indicator will spin in the upper right corner but the surface will not disappear, the item will not be recorded.
If you check your console you'll see you're getting an error upon pressing submit:
You're trying to access
bizonylatszamlaTable
insideajax.data
, which is why the submission is just hanging and doesn't complete.