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