Subversion Repositories SmartDukaan

Rev

Rev 1035 | Rev 1047 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1035 Rev 1043
Line 155... Line 155...
155
    var items = this.id;
155
    var items = this.id;
156
    var itemsarray = items.split('-');
156
    var itemsarray = items.split('-');
157
    addResearch(itemsarray[1], itemsarray[0]);
157
    addResearch(itemsarray[1], itemsarray[0]);
158
    return false;
158
    return false;
159
  });
159
  });
160
  $("#research_delete").click(function(){
-
 
161
    var research_tot=$("#research_total").val();
-
 
162
 
-
 
163
    var seldata="";
-
 
164
    var tot=0;
-
 
165
    var saprt="";
-
 
166
    var containerdiv = "#pane1";
-
 
167
    var par= containerdiv + " input[type=checkbox]:checked";
-
 
168
    $(par).each(function(){
-
 
169
      saprt = (tot>0)? "_":"";
-
 
170
      seldata += saprt+$(this).val();
-
 
171
      tot++
-
 
172
    });
-
 
173
    if(tot>0){
-
 
174
      var t=(research_tot*1)-(tot*1);
-
 
175
      $("#research_total").val(t);
-
 
176
 
-
 
177
      //alert("AJAX request to delete products in research. Product ID: "+seldata+" and total: "+tot);
-
 
178
      jQuery.ajax({
-
 
179
        type: "GET",
-
 
180
        url: "/myresearch/" + seldata + "?_method=delete",
-
 
181
        data: "productid="+seldata,
-
 
182
        success: function(msg){
-
 
183
        //   alert( "Data Saved: " + msg );
-
 
184
        }
-
 
185
      });
-
 
186
      var arrayprod_id=seldata.split("_");
-
 
187
      jQuery.each(arrayprod_id,function(intIndex, objValue){
-
 
188
        var tableref="#"+objValue;
-
 
189
        $(tableref).animate({
-
 
190
          backgroundColor: "#fcffb3"
-
 
191
        }, 'slow');
-
 
192
        $(tableref).animate({
-
 
193
          backgroundColor: "#F5F5F5"
-
 
194
        }, 'slow', function() {
-
 
195
          $(this).fadeOut('slow', function() {
-
 
196
            $(this).remove();
-
 
197
            if(t === 0){
-
 
198
              $("#research_default").css("display","block");
-
 
199
            }
-
 
200
          } )
-
 
201
        });
-
 
202
 
-
 
203
      });
-
 
204
    }else{
-
 
205
      alert("Please select atleast one product");
-
 
206
    }
-
 
207
  });
-
 
208
});
-
 
209
 
160
 
-
 
161
	$("#research_delete").click(function(){
-
 
162
		var research_tot = $("#research_total").val();
-
 
163
		var seldata = "";
-
 
164
		var tot = 0;
-
 
165
		var saprt = "";
-
 
166
		var containerdiv = "#pane1";
-
 
167
		var par = containerdiv + " input[type=checkbox]:checked";
210
 
168
 
-
 
169
		$(par).each(function(){
-
 
170
			saprt = (tot > 0) ? "_" : "";
-
 
171
			seldata += saprt + $(this).val();
-
 
172
			tot ++;
-
 
173
		});
-
 
174
	
-
 
175
		if(tot > 0)	{
-
 
176
			var t = (research_tot * 1) - (tot * 1);
-
 
177
			$("#research_total").val(t);
-
 
178
	
-
 
179
			jQuery.ajax({
-
 
180
				type: "GET",
-
 
181
				url: "/myresearch/" + seldata + "?_method=delete",
-
 
182
				data: "productid=" + seldata,
-
 
183
				success: function(msg){
-
 
184
					jQuery.each(seldata.split("_"), function(intIndex, objValue){
-
 
185
						$("#pane1").find("#" + objValue).fadeOut('slow', function() {
-
 
186
							$(this).remove();
-
 
187
							if(t === 0)	$("#research_default").css("display", "block");
-
 
188
						});
-
 
189
					});
-
 
190
				}
-
 
191
			});
-
 
192
		} else	{
-
 
193
			alert("Please select atleast one product");
-
 
194
		}
-
 
195
	});
-
 
196
});
211
197