Jeditable ID not showing

Jeditable ID not showing

jaultjault Posts: 5Questions: 0Answers: 0
edited May 2012 in General
First of all...I'm a newbie. I'm using asp.net, and a webservice that is passing json. I have just about everything working. But I can't seem to get the ID attached to the row. I read that it would automatically assume the first column. I know there is an id in the data being passed (although it's not called ID).

$.ajax({
type: "POST",
url: "//WebService.asmx/GetQuestionsBySID",
data: "{sid:" + sid + "}", // data: '{"synchroniseCustomers": ' + customerString + '}'

contentType: "application/json; charset=utf-8",
dataType: "json",
success: buildMyDatatable
});

function buildMyDatatable(result) {
// ASP.NET encapsulates JSON responses in a property "d", so remove it
if (result.hasOwnProperty("d")) { result = result['d']; }
var data = result;
var x = JSON.parse(data);
data = x.aaData;

//console.log(data);

$('#divformytable').html('');




var oTable = $('#myDataTable').dataTable({
"bPaginate": false,
"bAutoWidth": false,
"bJQueryUI": true,
"bLengthChange": true,
//"fnRowCallback": customFnRowCallback,
"aaData": data,

"aoColumns": [
//Assign the data to rows
{"mDataProp": "idsurvey_titles", "sTitle": "id"},
{ "mDataProp": "sid", "sTitle": "sid", "bSearchable": false, "bVisible": false },
{ "mDataProp": "field_name", "sTitle": "Field Name" },
{ "mDataProp": "label", "sTitle": "Label" },
{ "mDataProp": "required", "sTitle": "Required", "bSearchable": false },
{ "mDataProp": "report", "sTitle": "Report", "bSearchable": false },
{ "mDataProp": "export", "sTitle": "Export", "bSearchable": false },

{ "mDataProp": "field_type", "sTitle": "field_type", "bSearchable": false, "bVisible": false },
{ "mDataProp": "cap", "sTitle": "Cap", "bSearchable": false },
{ "mDataProp": "sku",
"fnRender": function (oObj) {
return 'View Opts';
// return 'View Opts';
// return 'View Opts';
// return 'View Opts';
}
}
]
}).makeEditable({
sUpdateURL: "WebService.asmx/DoQuestionUpdate",

aoColumns: [


null, // idsurvey_titles (unique id to make updates)
// null, // sid (already null)
null, // field_name
{
indicator: 'Saving "label"...',
tooltip: 'Double-lick to edit "label"',
type: 'textarea',
submit: 'Save changes',
fnOnCellUpdated: function (sStatus, sValue, settings) {
alert("(Cell Callback): Cell is updated with value " + sValue);
}
},
{
indicator: 'Saving "required"...',
tooltip: 'Double-lick to edit "required"',
submit: 'Save changes',
fnOnCellUpdated: function (sStatus, sValue, settings) {
alert("(Cell Callback): Cell is updated with value " + sValue);
}
},
{
indicator: 'Saving "report"...',
tooltip: 'Double-lick to edit "report"',
submit: 'Save changes',
fnOnCellUpdated: function (sStatus, sValue, settings) {
alert("(Cell Callback): Cell is updated with value " + sValue);
}
},
{
indicator: 'Saving "export"...',
tooltip: 'Double-lick to edit "export"',
submit: 'Save changes',
fnOnCellUpdated: function (sStatus, sValue, settings) {
alert("(Cell Callback): Cell is updated with value " + sValue);
}
},
// null,
{
indicator: 'Saving "cap"...',
tooltip: 'Double-lick to edit "cap"',
submit: 'Save changes',
fnOnCellUpdated: function (sStatus, sValue, settings) {
alert("(Cell Callback): Cell is updated with value " + sValue);
}
},
null
]
});

}

Replies

  • jaultjault Posts: 5Questions: 0Answers: 0
    Also, I'm trying to set it up so that they can edit each cell.
This discussion has been closed.