=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisPaging.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisPaging.js 2011-05-23 13:05:25 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.dhisPaging.js 2011-05-23 13:51:02 +0000 @@ -33,11 +33,13 @@ // Support functions // ----------------------------------------------- +/* perform dblclick action on the sourceId */ function dhisPaging_moveAllSelected(sourceId) { jQuery("#" + sourceId).dblclick(); } +/* select all options and perform dblclick action on the sourceId */ function dhisPaging_moveAll(sourceId) { var jqSource = jQuery("#" + sourceId); @@ -45,6 +47,69 @@ jqSource.dblclick(); } +/* + * + */ +function dhisPaging_availableList_dblclick(sourceId, targetId, removeArray) { + var jqAvailableList = jQuery("#" + sourceId); + var jqSelectedList = jQuery("#" + targetId); + + var settings = jqAvailableList.data("settings"); + + jqAvailableList.find(":selected").each(function(i) { + var jqThis = jQuery(this); + var option_id = +jqThis.attr("value"); + + jqSelectedList.append( this ); + + if( jQuery.isArray(settings[removeArray]) ) { + settings[removeArray].push(option_id); + } else { + settings[removeArray] = [option_id]; + } + }); + + if(settings[removeArray] && settings[removeArray].length > 0) { + settings.params[removeArray] = settings[removeArray].join(","); + } else { + delete settings[removeArray]; + delete settings.params[removeArray]; + } + + jqAvailableList.dhisPaging("load", sourceId); +} + +/* + * + */ +function dhisPaging_selectedList_dblclick(sourceId, targetId, removeArray) { + var jqAvailableList = jQuery("#" + targetId); + var jqSelectedList = jQuery("#" + sourceId); + + var settings = jQuery("#" + targetId).data("settings"); + + jqSelectedList.find(":selected").each(function(i) { + var jqThis = jQuery(this); + var option_id = +jqThis.attr("value"); + jqThis.remove(); + + if( jQuery.isArray(settings[removeArray]) ) + { + var remove_idx = jQuery.inArray(option_id, settings[removeArray]); + settings[removeArray].splice(remove_idx, remove_idx+1); + } + }); + + if(settings[removeArray] && settings[removeArray].length > 0) { + settings.params[removeArray] = settings[removeArray].join(","); + } else { + delete settings[removeArray]; + delete settings.params[removeArray]; + } + + jqAvailableList.dhisPaging("load", targetId); +} + // ----------------------------------------------- // Plugin // ----------------------------------------------- === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addDataSet.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addDataSet.vm 2011-05-20 11:01:54 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addDataSet.vm 2011-05-23 13:51:02 +0000 @@ -1,13 +1,24 @@