Editable Plugin
Editable Plugin
nobody.gavin
Posts: 5Questions: 0Answers: 0
[code]
"fnDrawCallback": function() {
$('#example tbody td:nth-child(3)').editable( function(value, settings) {
return(value);
}, {
callback: function( sValue, y ) {
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( sValue, aPos[0], aPos[1] );
},
submitdata: function ( value, settings ) {
return { "row_id": this.parentNode.getAttribute('id') };
},
tooltip : "Doubleclick to edit",
onblur : "submit",
event : "click",
height: "14px",
data : " {'Win':'Windows','Linux':'Linux System','Unix':'Unix System'}",
type:"select"
} );
[/code]
I would like to use JSON instead of " {'Win':'Windows','Linux':'Linux System','Unix':'Unix System'}"
Any Clue on how to do that? thanks.
"fnDrawCallback": function() {
$('#example tbody td:nth-child(3)').editable( function(value, settings) {
return(value);
}, {
callback: function( sValue, y ) {
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( sValue, aPos[0], aPos[1] );
},
submitdata: function ( value, settings ) {
return { "row_id": this.parentNode.getAttribute('id') };
},
tooltip : "Doubleclick to edit",
onblur : "submit",
event : "click",
height: "14px",
data : " {'Win':'Windows','Linux':'Linux System','Unix':'Unix System'}",
type:"select"
} );
[/code]
I would like to use JSON instead of " {'Win':'Windows','Linux':'Linux System','Unix':'Unix System'}"
Any Clue on how to do that? thanks.
This discussion has been closed.
Replies
var returnArray;
$.ajax({
"dataType": 'json',
"type": "POST",
"url": "SelectDataServlet",
"success": function(data) {
returnArray= data;
}
});
"fnDrawCallback": function() {
$('#example tbody td:nth-child(3)').editable( function(value, settings) {
return(value);
}, {
callback: function( sValue, y ) {
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( sValue, aPos[0], aPos[1] );
},
submitdata: function ( value, settings ) {
return { "row_id": this.parentNode.getAttribute('id') };
},
tooltip : "Doubleclick to edit",
onblur : "submit",
event : "click",
height: "14px",
data : returnArray,
type:"select"
} );
[/code]
Looks like it works.