Looking for some help on a problem I'm experiencing with YUI's AJAX and a YUI Datatable integration. The AJAX request is functioning properly, returning the correct data formatted as follows:
{NoteId:'" + result.NoteId + "', CreatedOn:'" + result.CreatedOn.ToShortDateString() +
"', UpdatedOn:'" + result.UpdatedOn.ToShortDateString() + "', CreatedBy:'" + result.CreatedBy +
"', NoteContent:'" + result.NoteContent + "'}
The formatting aligns with the table identities, which I took from the initial datatable creation statement that is working fine. However, I suspect there may be an issue with the 'onSuccess' function for my AJAX call since this is my first encounter with YUI.
Interestingly, manually executing noteTable.addRow and hard coding the data works without any issues.
Below is the code snippet for the AJAX call and Table Update:
function addNote() {
var noteText = editor.get('element').value;
var id = '<%= Model.Menu.Level1Tab %>'
var lpqId = <%= Model.LpqID %>
var sUrl = "/Lpm/Notes";
var callback = {
success: function(o) {
noteTable.addRow(o.responseText);
},
failure: function(o) {
}
}
var transaction = YAHOO.util.Connect.asyncRequest('POST', sUrl, callback, 'id=' + id + '¬eContent=' + noteText + '¬eId=' + noteId + '&lpqId=' + lpqId);
}
I seem to be stuck at this point, so any advice on where I might have gone wrong would be greatly appreciated. If more information is required, I can provide plenty of details including Firebug debugging logs. Thank you in advance for your assistance.