Select Update not working
Select Update not working
devinder1995
Posts: 5Questions: 2Answers: 0
editor = new $.fn.dataTable.Editor( {
ajax: "examples/php/staff.php",
table: "#example",
fields: [ {
label: "Task",
name: "task.name"
}, {
label: "Category",
name: "category.name",
type: "select",
options: [
{ label: "1 (highest)", value: "1" },
{ label: "2", value: "2" },
{ label: "3", value: "3" },
{ label: "4", value: "4" },
{ label: "5 (lowest)", value: "5" }
]
}, {
label: "Supplier",
name: "suppliers.company_name"
},
{
label:'Start Date',
name:'task.start_date',
type: 'datetime',
def: function () { return new Date(); }
},
{
label:'End Date',
name:'task.end_date',
type: 'datetime',
def: function () { return new Date(); }
},
{
label:'Start Budget',
name:'task.start_budget',
},
{
label:'End Budget',
name:'task.end_budget',
},
{
label:'Start Actual ',
name:'task.start_actual',
},
{
label:'End Actual',
name:'task.end_actual',
},
{
label: "Cost Code",
name: "task.cost_code"
}, {
label: "GST",
name: "task.gst"
}
]
} );
I am using editor like this all other fields are working but when i am updating using the select box ,it is not working .I am not even getting an error.Can someone help me on this
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Can you give me a link to the page so I can take a look and see what is going wrong with the select list please?
Thanks,
Allan
Actually i am working on localhost ....So link sharing is not possible;
And i am also trying to use a checkbox that will be checked if value from db is yes ...I am able to show it but i am not able to update value back after unchecking/checking.. i am not sure what i am doing wrong
you can access it here
Are you able to give me a link to a running test case please? I don't immediately see anything wrong with your code there, so I would need to be able to see the interaction between the client and the server.
That said, one thing that does look a little odd is the name of the field -
category.name
. Do you not want to edit something liketask.categoryId
?Allan
One other thing that would be useful - could you show me the JSON data that
examples/php/staff.php
is returning when the DataTable loads please?Allan