/*
TODO:
prendere lo stato !!!
*/
$(document).ready(function(){
$("#searchform").submit(
function (event) {
event.preventDefault();
dataString = $(this).serialize();
var request = $.getJSON('/api/search', dataString);
$("#searchresult").html(" ");
request.done( function(data) {
$.each(data, function(key, val) {
console.log("Extract " + key );
var divstring = "
";
$("#searchresult").append( divstring );
// var str = newformstr( key ); // new form
var str = "";
str += "";
str += "RECID: "+val.recid+" ID: "+ val.id + " Active " + val.active + "
";
str += "["+val.starttime+" >>> "+val.endtime+"]
"
$("#"+rs_trxarea(key)).html(str);
$("#delete-"+val.id).click(function(evt) {
evt.preventDefault();
recDelete(val.recid, rs_trxarea(key) );
}
); // End of delete link handler
});
});
});
$("#searchform").submit();
});
// vim: set ts=4 sw=4 noet: