// $Id: listsurvey.js 9692 2011-01-15 21:31:10Z c_schmitz $ $(document).ready(function(){ var old_owner = ''; $(".ownername_edit").live('click',function(){ var oldThis = this; var ownername_edit_id = $(this).attr('id'); var survey_id = ownername_edit_id.slice(15); var translate_to = $(this).attr('translate_to'); var initial_text = $(this).html(); $.getJSON(getuserurl,'',function(oData) { old_owner = $($(oldThis).parent()).html(); old_owner = (old_owner.split("("))[0]; $($(oldThis).parent()).html('' + ''); $(oData).each(function(key,value){ $('#ownername_select_'+survey_id). append($(""). attr("value",value[0]). text(value[1])); }); $("#ownername_select_"+survey_id+ " option[id=opt_"+old_owner+"]").attr("selected","selected"); }); }); $(".ownername_button").live('click',function(){ var oldThis = this; var initial_text = $(this).attr('initial_text'); var ownername_select_id = $(this).attr('id'); var survey_id = ownername_select_id.slice(17); var newowner = $("#ownername_select_"+survey_id).val(); var translate_to = $(this).attr('value'); $.getJSON(ownerediturl+'/newowner/' + newowner + '/surveyid/' + survey_id,'', function (data){ var objToUpdate = $($(oldThis).parent()); if (data.record_count>0) $(objToUpdate).html(data.newowner); else $(objToUpdate).html(old_owner); $(objToUpdate).html($(objToUpdate).html() + ' ('+initial_text+')' ); }); }); $("#addbutton").click(function(){ id=2; html = "\n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\\n\\n\ \n\\n\ \n\ "; $('#searchtable tr:last').after(html); }); var searchconditions = {}; var field; $('#searchbutton').click(function(){ }); var lastSel,lastSel2; function returnColModel() { if($.cookie("detailedsurveycolumns")) { hidden=$.cookie("detailedsurveycolumns").split('|'); for (i=0;i