Explorar o código

- Search forms now display the subclasses of the specified class...

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@393 a333f486-631f-4898-b8df-5754b55c2be0
dflaven %!s(int64=15) %!d(string=hai) anos
pai
achega
832db3e896
Modificáronse 1 ficheiros con 28 adicións e 0 borrados
  1. 28 0
      js/utils.js

+ 28 - 0
js/utils.js

@@ -49,3 +49,31 @@ function UpdateFileName(id, sNewFileName)
 	$('#'+id).val(sNewFileName);
 	$('#name_'+id).text(sNewFileName);
 }
+/**
+ * Reload a search form for the specified class
+ */
+function ReloadSearchForm(divId, sClassName, sBaseClass)
+{
+	$('#'+divId).block();
+	var formEvents = $('#'+divId+' form').data('events');
+	var bSubmitHookIsUsed = false;
+	if ( (formEvents != undefined) && (SubmitHook != undefined))
+	{
+		// Assume that we're using the function submit hook...
+		bSubmitHookIsUsed = true;
+	}
+	$('#'+divId+' form').unbind('submit');
+	$.get('ajax.render.php',
+	   { operation: 'search_form', className: sClassName, baseClass: sBaseClass, currentId: divId },
+	   function(data){
+		   $('#'+divId).empty();
+		   $('#'+divId).append(data);
+		   if (bSubmitHookIsUsed)
+		   {
+			   $('#'+divId+' form').bind('submit', SubmitHook);
+		   }
+		   $('#'+divId).unblock();
+	   }
+	 );
+
+}