Sha256: 9dac0c29efb8f5273fc3f4753f7530352076ccc12df2e48ba208414fb560fdac

Contents?: true

Size: 1.77 KB

Versions: 22

Compression:

Stored size: 1.77 KB

Contents

$(function () {
     $("[master]").each(function() {
			    var sub = $(this);
			    var master = $("#f_" + $(this).attr("master"));
			    var sel = sub.find("select");

			    var chFunc = function() {
				sub.find(".subLoader").show();
				sub.find(".fishText").hide();
				sel.show();
				var val = master.val();
				if (val)
				    $.post("/api/" + objEdit + "/subList",
					   {"field": sub.attr("id").substr(4),
					    "value": val,
					    "ownerField": sub.attr("owner"),
					    "loadData": sub.attr("loadData"),
					    "nameField": sub.attr("field")},
					   function(data) {
					       sel.html("");
					       $(data).find("line").each(function() {
									     var text = "<option value=\"" + $(this).find("id").text() + "\"";
									     $(this).find("params").children().each(function() { text+= " data-" + $(this)[0].tagName.toLowerCase() + "=\"" + $(this).text() + "\""; });
									     text+= ">" + $(this).find("name").text() + "</option>";
									     $(text).appendTo(sel);
									 });
					       sub.find(".subLoader").hide();
					       if (sel.attr("selectValue")) {
						   sel.find("[value=\"" + sel.attr("selectValue") + "\"]").attr("selected", "true");
						   sel.removeAttr("selectValue")
					       }						   
					   },
					   "text");
				else {
				    sel.hide();
				    sub.find(".fishText").show();
				}
			    };
			    master.live("change", chFunc);
			    if (master.val())
				chFunc();
			});
      $(".selValue i.icon-search").live("click", function () {
				showFormModal($(this).parent().attr("form"));
			    });
      $(".selValue i.icon-remove").live("click", function() {
					    $(this).siblings("input").val("");
					    $(this).parent().siblings("input").val(0);
					});
  });

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
kirgudu_base-0.0.25 app/assets/javascripts/kirgudu_base/sub_select.js
kirgudu_base-0.0.23 app/assets/javascripts/kirgudu_base/sub_select.js
kirgudu_base-0.0.22 app/assets/javascripts/kirgudu_base/sub_select.js
kirgudu_base-0.0.21 app/assets/javascripts/kirgudu_base/sub_select.js
kirgudu_base-0.0.19 app/assets/javascripts/kirgudu_base/sub_select.js
kirgudu_base-0.0.18 app/assets/javascripts/kirgudu_base/sub_select.js
kirgudu_base-0.0.17 app/assets/javascripts/kirgudu_base/sub_select.js
kirgudu_base-0.0.16 app/assets/javascripts/kirgudu_base/sub_select.js
kirgudu_base-0.0.15 app/assets/javascripts/kirgudu_base/sub_select.js
kirgudu_base-0.0.14 app/assets/javascripts/kirgudu_base/sub_select.js
kirgudu_base-0.0.13 app/assets/javascripts/kirgudu_base/sub_select.js
kirgudu_base-0.0.12 app/assets/javascripts/kirgudu_base/sub_select.js
kirgudu_base-0.0.11 app/assets/javascripts/kirgudu_base/sub_select.js
kirgudu_base-0.0.10 app/assets/javascripts/kirgudu_base/sub_select.js
kirgudu_base-0.0.9 app/assets/javascripts/kirgudu_base/sub_select.js
kirgudu_base-0.0.8 app/assets/javascripts/kirgudu_base/sub_select.js
kirgudu_base-0.0.7 app/assets/javascripts/kirgudu_base/sub_select.js
kirgudu_base-0.0.6 app/assets/javascripts/kirgudu_base/sub_select.js
kirgudu_base-0.0.5 app/assets/javascripts/kirgudu_base/sub_select.js
kirgudu_base-0.0.4 app/assets/javascripts/kirgudu_base/sub_select.js