No data yet received
No data yet received
I have installed and configured Editor to update a field in a MySQL table.
I am working on example 1, (the index file in examples directory) on my localhost.
The Data from database loads into the table no problem, but when I choose a field and update it, the status box on the right never updates.
It just says "// No data yet received"
I understand, in principal, that this means the server is not responding but I cannot understand why.
The program is reading from the database.. why not updating?
Any help would be greatly appreciated at this time.
I am working on example 1, (the index file in examples directory) on my localhost.
The Data from database loads into the table no problem, but when I choose a field and update it, the status box on the right never updates.
It just says "// No data yet received"
I understand, in principal, that this means the server is not responding but I cannot understand why.
The program is reading from the database.. why not updating?
Any help would be greatly appreciated at this time.
This discussion has been closed.
Replies
Allan
I have changed my "Browsers.php" file. here is the the function that I believe receives the $_POST
[code]
// Build our Editor instance and process the data coming from _POST
Editor::inst( $db, 'apply_now_log' )
->fields(
Field::inst( 'first_name' )->validator( 'Validate::required' )
)
->process( $_POST )
->json();
[/code]
My table has many fields, does it matter that I have only mentioned this 1 field?
The files looks fine to me - at long are you include the DataTables library and `use` the required namespaces, like in my example files.
Did you look at the server error log? Was there anything in there? Also, what version of PHP are you using? It must be 5.3 or newer for the DataTables libraries.
Allan
(string) {"id":-1,"error":"","fieldErrors":[],"data":[],"aaData":[{"DT_RowId":"row_1","tag":"dictionary"},{"DT_RowId":"row_2","tag":"store"},{"DT_RowId":"row_3","tag":"license"},{"DT_RowId":"row_55","tag":"test"},{"DT_RowId":"row_756","tag":"576567567ghjnfgh"},{"DT_RowId":"row_757","tag":"data_test"},{"DT_RowId":"row_758","tag":"fghfgh"},{"DT_RowId":"row_759","tag":"test_db"}]}
The table never shows anything and spits out a json formatting error. If I click the New button I can add another table entry (verified with another sqlite management tool), but nothing ever shows up in the table for display.
So close, yet so far. Any ideas what I could be doing wrong? Nothing in the Apache logs either, so the code is pretty clean.
from the php file.
// Build our Editor instance and process the data coming from _POST
Editor::inst( $db, 'dict_dbs' )
->fields(
Field::inst( 'tag' )
)
->process( $_POST )
->json();
from the .js file
$(document).ready(function() {
var editor = new $.fn.dataTable.Editor( {
"ajaxUrl": "/tabs/php/table.dict_dbs.php",
"domTable": "#dict_dbs",
"fields": [
{
"label": "Name",
"name": "tag",
"type": "text"
}
]
} );
$('#dict_dbs').dataTable( {
"sDom": "Tfrtip",
"sAjaxSource": "/tabs/php/table.dict_dbs.php",
"aoColumns": [
{
"mData": "tag"
}
],
"oTableTools": {
"sRowSelect": "multi",
"aButtons": [
{ "sExtends": "editor_create", "editor": editor },
{ "sExtends": "editor_edit", "editor": editor },
{ "sExtends": "editor_remove", "editor": editor }
]
}
} );
} );
(string) {"id":"row_762","error":"","fieldErrors":[],"data":[],"row":{"DT_RowId":"row_762","tag":"real_data"}}
It seems to have an error, but it actually does store the record and then on the Edit form says to contact the Administrator.
Allan
if ( $print ) {
$enc = json_encode( $this->_out );
echo $enc;
return $this;
}
Further to the json for the issue of not loading the initial table, it says {"id":-1. Since I have not had a working module I do not know if this is a problem or not. I am going to give this a try with pgsql or maybe even break down and install mysql. Once I can play with a working unit then I can fool with sqlite. It is awesome to see this almost working and little or no coding has been done. I'm sure it is something simple. Just have to find it. It would sure be nice to have a debugger in the browser for the javascript. Being able to single step and watch variables is so invaluable. Right now the javascript is a big black hole and I need a flashlight to see what is in the hole.
Allan
$db = new Database( $sql_details );
//echo ('after db assign for debugger');
with the comment in place this works perfectly.
This Editor is really cool. As part of my troubleshooting I changed to a Postgres database and it took all of 2 minutes. Now I can go wild.
Thanks for an excellent piece of code. I have never worked with Namespaces but it sure looks good and for sure, you are a way better programmer than I. Very clever.