I cannot update the screen and therefore the records in the "excel like keyboard navigation" program
I cannot update the screen and therefore the records in the "excel like keyboard navigation" program
hi,
**
I get this error when I send a parameters to staff.php file with POST method in editor of datatables in "excel like keyboard navigation" application. http://e-performans.net/excelgiris/examples/extensions/keyTable8.php
**
keyTable8.php
<? php
$ k = '01';
$ t = '2020-01-05';
<?php
>
?>
Sending parameters.
ajax: {
url: "../../controllers/staff.php",
type: 'POST',
dataType: "json",
data: {
k: "<? php echo $ k;?>",
t: "<? php echo $ t;?>"
}
},
staff.php
$ k = $ _POST ['k']; $ t = $ _POST ['t']; // incoming from keytables8.php
-> where ('FatMarker', $ k, '=')
-> where ('Date', $ t, '=')
Result
Records are visible, but when the record in a cell is changed, an error "A system error has occured (more information)" occurs. - when we want to change...
But when I get the same error as a fixed value in staff.php, I don't get it. http://e-performans.net/excelgiris/examples/extensions/keyTable9.php
keyTable9.php
<? php
$ k = '01';
$ t = '2020-01-05';
<?php
>
```
?>
Sending parameters.
ajax: {
url: "../../controllers/staff.php",
type: 'POST',
dataType: "json",
data: {
k: "<? php echo $ k;?>",
t: "<? php echo $ t;?>"
}
},
staff.php
-----------------
// !!!! $ k = $ _POST ['k']; $ t = $ _POST ['t']; // incoming from keytables9.php !!!!!! not working
but,
$ k = '01'; $ t = '2020-01-05'; works?. Could I explain?
-> where ('FatMarker', $ k, '=')
-> where ('Date', $ t, '=')
Result
========
The records are visible, but when the record in a cell is changed I don't get the "A system error has occured (more information)" error, so it works fine :)
![](https://datatables.net/forums/uploads/editor/rq/jzm8xkso3agt.png "")
----------------------------------------------------------------------------------------------
Sample staff.php and other
<?php
/*;
* Example PHP implementation used for the index.html example
*/
// DataTables PHP library
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;
//$k = $_POST['k']; $t = $_POST['t']; // incoming from form
$k = '01'; $t = '2020-01-05';
Editor::inst( $db, "tahsilattbl" )
-> fields(
Field::inst( 'FatPazarlamaci' ),
Field::inst( 'Tarih' ),
Field::inst( 'FatCarkod' ),
Field::inst( 'Satis' )
->validator( Validate::numeric() )
->setFormatter( Format::ifEmpty(null) ),
Field::inst( 'Tahsilat' )
->validator( Validate::numeric() )
->setFormatter( Format::ifEmpty(null) ),
Field::inst( 'KrediKarti' )
->validator( Validate::numeric() )
->setFormatter( Format::ifEmpty(null) ),
Field::inst( 'Cek' )
->validator( Validate::numeric() )
->setFormatter( Format::ifEmpty(null) ),
Field::inst( 'BozukPara' )
->validator( Validate::numeric() )
->setFormatter( Format::ifEmpty(null) ),
Field::inst( 'Nakit' )
->validator( Validate::numeric() )
->setFormatter( Format::ifEmpty(null) ),
Field::inst( 'Havale' )
->validator( Validate::numeric() )
->setFormatter( Format::ifEmpty(null) ),
Field::inst( 'HariciGelen' )
->validator( Validate::numeric() )
->setFormatter( Format::ifEmpty(null) )
)
-> where( 'FatPazarlamaci', $k, '=')
-> where( 'Tarih', $t, '=')
-> process( $_POST )
-> json();
?>
```
respects
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
Replies
Hi,
The response from the server to your
System error
issue is:Which is correct - a
k
andt
parameter are not being sent to the server on edit. It is for the data get request by DataTables, but you don't have anajax.data
for Editor. Seeajax.data
for details on how to add it.Allan
Hello Mr. Allan, thank you for your answer. My problem is solved.