Add a new row in Mysql DataBase
Add a new row in Mysql DataBase
Bastou
Posts: 3Questions: 0Answers: 0
Hi,
when i add a row in my table, my file AddData.php is never called. I follow the instructions from the page http://code.google.com/p/jquery-datatables-editable/wiki/AddingNewRecords and the demo http://jquery-datatables-editable.googlecode.com/svn/trunk/addingrecords.html.
this is my code
[code]
$(document).ready( function () {
var oTable = $('#example').dataTable({
"bJQueryUI": true,
"bProcessing": true,
"sPaginationType": "full_numbers",
}).makeEditable({
sAddURL: "AddData.php",
sDeleteURL: "DeleteData.php",
sAddDeleteToolbarSelector:".dataTables_length,
oAddNewRowFormOptions: {
title: 'Add a new entry',
show: "blind",
hide: "explode",
modal: true
},
"aoColumns": [
null,
null,
null,
{
indicator: 'Saving',
tooltip: 'Click to edit',
type: 'text',
sUpdateURL: "UpdateData.php",
},
null,
null,
null,
null,
null
]
});
});
[/code]
I forget something or i didn't understand something. If someone has ever had this problem ... Thanks
when i add a row in my table, my file AddData.php is never called. I follow the instructions from the page http://code.google.com/p/jquery-datatables-editable/wiki/AddingNewRecords and the demo http://jquery-datatables-editable.googlecode.com/svn/trunk/addingrecords.html.
this is my code
[code]
$(document).ready( function () {
var oTable = $('#example').dataTable({
"bJQueryUI": true,
"bProcessing": true,
"sPaginationType": "full_numbers",
}).makeEditable({
sAddURL: "AddData.php",
sDeleteURL: "DeleteData.php",
sAddDeleteToolbarSelector:".dataTables_length,
oAddNewRowFormOptions: {
title: 'Add a new entry',
show: "blind",
hide: "explode",
modal: true
},
"aoColumns": [
null,
null,
null,
{
indicator: 'Saving',
tooltip: 'Click to edit',
type: 'text',
sUpdateURL: "UpdateData.php",
},
null,
null,
null,
null,
null
]
});
});
[/code]
I forget something or i didn't understand something. If someone has ever had this problem ... Thanks
This discussion has been closed.
Replies
Thanks Allan for your work, it's a great pleasure to develop with DataTables !!!!
Can you help me i have problem to write my addData.php
yes i can :). Can you explain to me your problem et can you post your code ?
Can you post the changes you've made?
Tq (=
You might be interested in Editor, a new plug-in that I've been readying for DataTables: http://editor.datatables.net . Not quite announced yet, it it will be very soon :-)
Allan
Where have you been hiding that?
Having to implement that on our own is always a pain in the ass.
No competition after that.
Looking so forward to it.. Jesus, what a hell of a nice work that editor :)
Quick note: don't forget my PM :)
Can you explain how you solve the problem?
THx
[quote]rowData is not defined
rtn = oTable.fnAddData(rowData);[/quote]
adddata.php returns the new record id.
i do NOT use the server side processing. is this the problem? in examples there is also no serverside processing...
my code:
[code]
$(document).ready( function () {
var oTable = $('#table_id').dataTable().makeEditable({
sUpdateURL: "ajax/update.cfm",
sAddURL: "ajax/add.cfm",
sDeleteURL: "ajax/delete.cfm"
});
});
[/code]