Editable column
Editable column
Sorry,
i have some problems because i can't use that kind of table. I'm trying to connect with the table to database which should be updated after change that column. I thoght i could do that with jeditable.
i cant use that table, what should i do? the example is a little bit short, i don't understand the use.
thxs.
i have some problems because i can't use that kind of table. I'm trying to connect with the table to database which should be updated after change that column. I thoght i could do that with jeditable.
i cant use that table, what should i do? the example is a little bit short, i don't understand the use.
thxs.
This discussion has been closed.
Replies
oTable = $('#example').dataTable({
"oLanguage": {
"sUrl": "language/spanish_table.txt"
},
"sPaginationType": "full_numbers",
"bJQueryUI": true,
"bProcessing": true,
"bServerSide": true,
"aaSorting": [[0, 'asc']],
"sAjaxSource": "php/products.php"
});
$('#example td').editable( 'php/server.php', {
alert("SI");
} );
} );
R
Modelo
Colecci
i have this code now,
[code]
var oTable;
$(document).ready(function() {
oTable = $('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "php/administradors.php",
"fnDrawCallback": function () {
$('#example tbody td').editable( 'php/server.php', {
"callback": function( sValue, y ) {
var aPos = oTable.fnGetPosition( this );
var aData = oTable.fnGetData( aPos[0] );
alert(y);
//oTable.fnUpdate(sValue, aPos[0], aPos[1]);
//oTable.fnDraw();
},
"error": function (XMLHttpRequest, textStatus, errorThrown) {
alert( "XMLHttpRequest: "+XMLHttpRequest+" errorThrown: "+errorThrown+" textStatus: "+textStatus );
},
"cssclass" : 'expanding',
"height": "14px",
"event" : "click",
"tooltip" : 'Haz click para editarlo...',
"indicator" : 'saving',
});
}
} );
} );
[/code]
it works, now i have some problemes.. the PHP server.php is processing de callback call.I need pass to that PHP more than new value, some identifier to update database. How can i do that??
please need help.
I would like to pass another param to php, to do a switch in php, to know which attribute update in database.
thxs
Allan
i solved like this
[code]
$(document).ready(function() {
TableToolsInit.sSwfPath = "media/swf/ZeroClipboard.swf";
table = $("#example").dataTable( {
"sDom": 'T<"clear">lfrtip',
"oLanguage": {
"sUrl": "language/spanish_table.txt"
},
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bProcessing": true,
"bServerSide": true,
"aaSorting": [[0, 'asc']],
"sAjaxSource": "php/administradors.php",
"fnDrawCallback": function () {
$("#example tbody td").editable( "php/server.php", {
"callback": function( sValue, y ) {
//$(this).highlightFade({ start: 'red', iterator: 'sinusoidal', speed: 3000 });
var aPos = table.fnGetPosition( this );
var aData = table.fnGetData( aPos[0] );
sleep(1000);
table.fnDraw();
},
submitdata : function(value, settings) {
var aPos = table.fnGetPosition( this );
var aData = table.fnGetData( aPos[0] );
return {
id: aData[0],
pos: aPos[1],
};
},
"cssclass" : "centerclass",
"cancel" : "No",
"indicator" : "",
"submit" : "Ok",
"height" : "14px",
"event" : "click",
"tooltip" : "Haz click para editarlo...",
});
}
} );
} );
[/code]
i'm trying to fix one of the columns, because it can't be modified by user.. how can i do that?
thxs for ur fast answer
Allan
for example.. i don't want that column ID, the first column. how can i do that??
i tryed with .not("td:eq(0)") but doesnt work, because it just take de first row... why?