Jeditable support
Jeditable support
As you might know, jeditable requires for node to have id attribute set to be same as database column field name. This id is sent as column name so that we know what field we need to update. Also element needs id attribute to be set with database row id value to be sent as database row id to know what row this field belongs to.
So my question is: is there a way to add and id attributes when adding new rows with fnAddData and
when we use ajaxSource and Server Side processing?
So my question is: is there a way to add and id attributes when adding new rows with fnAddData and
when we use ajaxSource and Server Side processing?
This discussion has been closed.
Replies
i found hidden http://datatables.net/examples/server_side/editable.html (look into source) but this example seams to be unfinished :(
you can put fields as ids of header elements and it will grab them instead.
[code]
var submitdata = {};
submitdata[settings.name] = input.val();
//submitdata[settings.id] = self.id;
if (self.id)
{
submitdata[settings.id] = self.id
}
else
{
var i = $(this.parentNode).index( );
submitdata[settings.id] = $(this.parentNode.parentNode.parentNode.parentNode).children('thead').children('tr').children('th').eq(i).attr('id');
}
[/code]
And for row_id you can put first column to contain db row ids and hide it, in the same way as below take values of first column of selected row, something like this:
[code]
$(this.parentNode).children('td').eq(0).attr('id');
[/code]
[code]fnRowCallback = function (nRow, aData, iDisplayIndex) {
$(nRow).data('taskID', aData[0]);
return nRow;
};
[/code]
and I've been using jeditable's "submit to function" and putting together the request myself.