From ffa1efc1acfc176c1dbf659210b41a51eb4d4cad Mon Sep 17 00:00:00 2001 From: csitifr Date: Fri, 11 May 2012 16:31:53 +0530 Subject: Dynamic mapping for attribute types done.Dynamic form for relation types added for both types and tokens.Properties for getting ATs and RTs added into models --- objectapp/static/objectapp/js/savert.js | 10 +++++----- objectapp/static/objectapp/js/setMember.js | 12 +++++++++--- 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'objectapp/static/objectapp') diff --git a/objectapp/static/objectapp/js/savert.js b/objectapp/static/objectapp/js/savert.js index 0e1f8b07..549e8196 100644 --- a/objectapp/static/objectapp/js/savert.js +++ b/objectapp/static/objectapp/js/savert.js @@ -3,7 +3,7 @@ $ = django.jQuery $(document).ready(function() { - $("#id_submit_rt").ajaxSend(function(e,xhr,settings){ + $("#id_go").ajaxSend(function(e,xhr,settings){ function getCookie(name) { @@ -41,13 +41,13 @@ $ = django.jQuery xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken')); } }); - $("#id_submit_rt").click(function(){ + $("#id_go").click(function(){ left = document.getElementById("id_left") - rt = document.getElementById("id_reltype") + rt = document.getElementById("id_rel") right = document.getElementById("id_right") absolute_url = document.getElementById("id_back_url") - url = "/objects/dynamicRelation/save/"+ left.value + "/" +rt.value+"/"+right.value+"/" - // alert(url); + url = "/objects/dynamicRelation/save/"+ left.value+"/"+rt.value+"/"+right.value+"/" + //alert(url); $.get(url,function(data){ window.location.replace(absolute_url.value); }); diff --git a/objectapp/static/objectapp/js/setMember.js b/objectapp/static/objectapp/js/setMember.js index a71b6750..977bd63c 100644 --- a/objectapp/static/objectapp/js/setMember.js +++ b/objectapp/static/objectapp/js/setMember.js @@ -42,10 +42,16 @@ $ = django.jQuery } }); $("#id_select_mem").change(function(){ - right_member = $(this).val() - document.getElementById("id_right").value = right_member; - // alert("hello "+ right_member); + right = $(this).val() + left =document.getElementById("id_left") + rel=document.getElementById("id_rel") + document.getElementById("id_right").value = right; + //url="/objects/dynamicRelation/save/"+left.value+"/"+rel.value+"/"+right+"/" + //alert("hello "+ ur); + }); }); + + -- cgit v1.2.3-70-g09d2