hamoudamahboub / jquery-datatables-editable

Automatically exported from code.google.com/p/jquery-datatables-editable
0 stars 0 forks source link

Error when trying to Add records on server side #150

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Add new record

What is the expected output? What do you see instead?
No error popup is the expected. But I keep getting a popup saying :
DataTables warning (table id = 'dataTable'): Requested unknown parameter 
'Entity_Id' from the data source for row 5.
(Entity_Id) is my id column, it's an integer, it's the default sorting on 
datatables and it's added to each row as an id.

What version of the product are you using? On what operating system?

Windows Server, IIS 7 using the latest versions of jquery, datatabels

Please provide any additional information below.

Original issue reported on code.google.com by f...@shocklogic.com on 9 May 2013 at 10:09

Attachments:

GoogleCodeExporter commented 8 years ago
The files attached are as follows:

databaseedit.php is the one that renders the UI with the datatables
dbhelper.php is the file that gets the server side data
adddata.php is the file that handles the insert

Original comment by f...@shocklogic.com on 9 May 2013 at 10:11

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
It seems that there was something wrong with the JSON.

I've added sDefaultContent:"" to each one of the column declarations in 
aoColumns and the error is gone now.

So my aoColumns look something like this now

        "aoColumns": [
            { "mDataProp": "checkbox" ,"bSortable":false ,sDefaultContent:"", "sWidth" : "1%"},
            { "mDataProp": "Entity_Id" , "bSortable":true, "bVisible": false, sDefaultContent: "", "sWidth" : "1%"  },
            { "mDataProp": "External_Id" ,"bSortable":true, sDefaultContent: "", "sWidth" : "1%"  },
            { "mDataProp": "Family_Name" ,"bSortable":true, sDefaultContent: "", "sWidth" : "5%"  },
            { "mDataProp": "First_Name" ,"bSortable":true, sDefaultContent: "", "sWidth" : "5%"  },
            { "mDataProp": "Prefix_Title" ,"bSortable":true, sDefaultContent: "", "sWidth" : "1%"  },
            { "mDataProp": "Suffix_Title" ,"bSortable":true, sDefaultContent: "", "sWidth" : "1%"  },
            { "mDataProp": "Company" ,"bSortable":true, sDefaultContent: "", "sWidth" : "2%"  },
            { "mDataProp": "Address_1" ,"bSortable":true, sDefaultContent: "", "sWidth" : "2%"  },
            { "mDataProp": "Address_2" ,"bSortable":true, sDefaultContent: "", "sWidth" : "2%" },
            { "mDataProp": "Address_3" ,"bSortable":true, sDefaultContent: "", "sWidth" : "2%" },
            { "mDataProp": "Address_4" ,"bSortable":true, sDefaultContent: "", "sWidth" : "2%" },
            { "mDataProp": "Zip_Code" ,"bSortable":true, sDefaultContent: "", "sWidth" : "1%" },
            { "mDataProp": "City" ,"bSortable":true, sDefaultContent: "", "sWidth" : "2%" },
            { "mDataProp": "Country_Code" ,"bSortable":true, sDefaultContent: "", "sWidth" : "1%" },
            { "mDataProp": "Telephone" ,"bSortable":true, sDefaultContent: "", "sWidth" : "2%" },
            { "mDataProp": "Telefax" ,"bSortable":true, sDefaultContent: "", "sWidth" : "2%" },
            { "mDataProp": "EMail" ,"bSortable":true, sDefaultContent: "", "sWidth" : "2%" },
            { "mDataProp": "EMail2" ,"bSortable":true, sDefaultContent: "", "sWidth" : "2%" },
            { "mDataProp": "Session_Id" ,"bSortable":true, sDefaultContent: "", "bVisible": false, "sWidth" : "2%"  },
            { "mDataProp": "Gender" ,"bSortable":true, sDefaultContent: "", "sWidth" : "1%" },
            { "mDataProp": "JMUser_Id" ,"bSortable":true, sDefaultContent: "", "bVisible": false, "sWidth" : "1%"  },
            { "mDataProp": "Password" ,"bSortable":true, sDefaultContent: "", "bVisible": false, "sWidth" : "1%"  },
            { "mDataProp": "ExtraField01" ,"bSortable":true, sDefaultContent: "", "bVisible": true, "sWidth" : "2%"  },
            { "mDataProp": "ExtraField02" ,"bSortable":true, sDefaultContent: "", "bVisible": true, "sWidth" : "2%"  },
            { "mDataProp": "ExtraField03" ,"bSortable":true, sDefaultContent: "", "bVisible": true, "sWidth" : "2%"  },
            { "mDataProp": "ExtraField04" ,"bSortable":true, sDefaultContent: "", "bVisible": true, "sWidth" : "2%"  },
            { "mDataProp": "ExtraField05" ,"bSortable":true, sDefaultContent: "", "bVisible": true, "sWidth" : "2%"  },
            { "mDataProp": "ExtraField06" ,"bSortable":true, sDefaultContent: "", "bVisible": true, "sWidth" : "2%" },
            { "mDataProp": "ExtraField07" ,"bSortable":true, sDefaultContent: "", "bVisible": true, "sWidth" : "2%"  },
            { "mDataProp": "ExtraField08" ,"bSortable":true, sDefaultContent: "", "bVisible": true, "sWidth" : "2%"  },
            { "mDataProp": "ExtraField09" ,"bSortable":true, sDefaultContent: "", "bVisible": true, "sWidth" : "2%"  },
            { "mDataProp": "ExtraField10" ,"bSortable":true, sDefaultContent: "", "bVisible": true, "sWidth" : "2%"  },
            { "mDataProp": "Mobile" ,"bSortable":true, sDefaultContent: "", "bVisible": true, "sWidth" : "2%"  },
            { "mDataProp": "URL" ,"bSortable":true, sDefaultContent: "", "bVisible": true, "sWidth" : "2%"  },
            { "mDataProp": "Passport_Number" ,"bSortable":true, sDefaultContent: "", "bVisible": true, "sWidth" : "2%"  },
            { "mDataProp": "Nationality" ,"bSortable":true, sDefaultContent: "", "bVisible": true, "sWidth" : "2%"  },
            { "mDataProp": "ID_Number" ,"bSortable":true, sDefaultContent: "", "bVisible": true, "sWidth" : "2%"  },
            { "mDataProp": "Date_Of_Birth" ,"bSortable":true, sDefaultContent: "", "bVisible": true, "sWidth" : "2%"  },
            { "mDataProp": "Special_Needs_Physical" ,"bSortable":true, sDefaultContent: "", "bVisible": true, "sWidth" : "3%"  },
            { "mDataProp": "Special_Needs_Dietary" ,"bSortable":true, sDefaultContent: "", "bVisible": true, "sWidth" : "3%"  },
            { "mDataProp": "First_Name_For_Badge" ,"bSortable":true, sDefaultContent: "", "bVisible": true, "sWidth" : "5%"  },
            { "mDataProp": "Family_Name_For_Badge" ,"bSortable":true, sDefaultContent: "", "bVisible": true, "sWidth" : "5%"  },
            { "mDataProp": "Biography" ,"bSortable":true, "bVisible": true, sDefaultContent: "", "sWidth" : "2%"  },
            { "mDataProp": "VAT_Number" ,"bSortable":true, "bVisible": true, sDefaultContent: "", "sWidth" : "2%"  },
            { "mDataProp": "Membership_No" ,"bSortable":true, "bVisible": true, sDefaultContent: "", "sWidth" : "2%"  },
            { "mDataProp": "Participant_Template" ,"bSortable":true, "bVisible": true, sDefaultContent: "", "sWidth" : "1%"  },
            { "mDataProp": "Language_Code" ,"bSortable":true, "bVisible": true, sDefaultContent: "", "sWidth" : "1%"  }
            ],

All sorted!

Original comment by f...@shocklogic.com on 16 May 2013 at 8:01