I´m trying to add a file uploader to one jquery dataTable editable (http://code.google.com/p/jquery-datatables-editable/)
I tried adding a div to the form but fineUploader keeps the state from the last operation.
$(document).ready(function() {
$('#fine-uploader').fineUploader({
request: {
endpoint: ...
<form id="formAddNewMedia" action="#" title="Agregar un elemento">
<div id="fine-uploader"></div>
<label for=....
There is a method to reset all UI elements to the state they existed immediately after initialization... but i think the fileUploader should be built with the form activation and destroyed after it´s closed.
Something like a callback fnOnAddNewRow :
var oTable = $('#media_table').dataTable({
"sScrollY": "200px",
"bScrollCollapse": true,
"bPaginate": false,
"sAjaxSource": "/ajax_library_media.txt",
"bProcessing": true,
"oLanguage": {
"sUrl": "assets/js/dataTables.spanish.txt"
},
"bJQueryUI" : true
}).makeEditable({
sUpdateURL: "update_media.php",
sAddURL: "add_media.php",
fnOnAddNewRow (function() {
$('#fine-uploader').fineUploader({
request: {
endpoint: ...
Which i think can be added here in jquery.dataTables.editable.js
//Setup form to open in dialog
oAddNewRowForm = $("#" + properties.sAddNewRowFormId);
if (oAddNewRowForm.length != 0) {
if (properties.oAddNewRowFormOptions != null) {
properties.oAddNewRowFormOptions.autoOpen = false;
} else {
properties.oAddNewRowFormOptions = { autoOpen: false };
}
oAddNewRowForm.dialog(properties.oAddNewRowFormOptions);
//Add button click handler on the "Add new row" button
oAddNewRowButton = $("#" + properties.sAddNewRowButtonId);
if (oAddNewRowButton.length != 0) {
oAddNewRowButton.click(function () {
oAddNewRowForm.dialog('open');
});
} else {
if ($(properties.sAddDeleteToolbarSelector).length == 0) {
throw "Cannot find a button with an id '" + properties.sAddNewRowButtonId + "', od placeholder with an id '" + properties.sAddDeleteToolbarSelector + "' that should be used for adding new row although form for adding new record is specified";
} else {
oAddNewRowButton = null; //It will be auto-generated later
}
}
Where the dialog is opened with oAddNewRowForm.dialog('open');
Anyone with a sleep saving idea?!