Comments on: JQuery for Everyone: Extending OWS API for Calculated Columns http://www.endusersharepoint.com/2009/05/06/jquery-for-everyone-extending-ows-api-for-calculated-columns/ No GeekSpeak on SharePoint 2007 WSS and MOSS Mon, 27 Dec 2010 14:28:49 -0500 http://wordpress.org/?v=2.8.6 hourly 1 By: AutoSponge http://www.endusersharepoint.com/2009/05/06/jquery-for-everyone-extending-ows-api-for-calculated-columns/comment-page-1/#comment-14158 AutoSponge Wed, 01 Jul 2009 12:08:59 +0000 http://www.endusersharepoint.com/?p=1611#comment-14158 @Aaron, The only error I see, is you named ctx2 twice. Since owsapi only ever constructs one object, in the ows object, there will only be one context, ctx2. Try naming one of them something else. @Aaron,

The only error I see, is you named ctx2 twice. Since owsapi only ever constructs one object, in the ows object, there will only be one context, ctx2. Try naming one of them something else.

]]>
By: Aaron http://www.endusersharepoint.com/2009/05/06/jquery-for-everyone-extending-ows-api-for-calculated-columns/comment-page-1/#comment-14095 Aaron Mon, 29 Jun 2009 20:30:00 +0000 http://www.endusersharepoint.com/?p=1611#comment-14095 The problem that I seem to be having is that the value returned is undefined. From what I've found by googling, there seems to be an issue with returning the value of a nested function. I'm not sure if there is a way around that or not, I'm still searching.. Here is the code snippet that I'm currently working with: <pre lang="javascript" line="1"> function BuildGoogleChart(Data) { var DataPoints= "&chd=t:"+Data; return(""); } function GetX(){ $.fn.ows({ctx:"ctx2",list:"{C510C8F8-F624-46FA-8F55-8690C365B183}",view:"{CFF21CF7-9CA7-4CE8-AD08-F8A20BF31345}"}, function(o){ var r = ows.getSum(o.ctx,'Points').toFixed(1); $("#jLoadMe1").append(""+r+""); //control to ensure data is retrieved. return r; });} function GetY(){ $.fn.ows({ctx:"ctx2",list:"{08F609C4-5643-4E7B-B771-CF61E98C9DFA}",view:"{0F6C8393-BABA-41C7-BEC7-F8E072529F22}"}, function(o){ s = ows.getSum(o.ctx,'Points').toFixed(1); $("#jLoadMe1").append(""+s+""); //control to ensure data is retrieved. return s; }); } function BuildGoogleData(sData) { $("#jLoadMe1").append(BuildGoogleChart(sData)); } $(function(){ var xData = GetX(); var yData = GetY(); var cardArr = new Array(xData,yData); var cardSrt = cardArr.sort(); BuildGoogleData(cardSrt); }); </pre> The problem that I seem to be having is that the value returned is undefined. From what I’ve found by googling, there seems to be an issue with returning the value of a nested function. I’m not sure if there is a way around that or not, I’m still searching..

Here is the code snippet that I’m currently working with:

function BuildGoogleChart(Data)
    {
    var  DataPoints= "&chd=t:"+Data;  

return("");
    }

function GetX(){
$.fn.ows({ctx:"ctx2",list:"{C510C8F8-F624-46FA-8F55-8690C365B183}",view:"{CFF21CF7-9CA7-4CE8-AD08-F8A20BF31345}"}, function(o){
		var r = ows.getSum(o.ctx,'Points').toFixed(1);
                  $("#jLoadMe1").append(""+r+"");  //control to ensure data is retrieved.

	        return r;

		});}

function GetY(){

$.fn.ows({ctx:"ctx2",list:"{08F609C4-5643-4E7B-B771-CF61E98C9DFA}",view:"{0F6C8393-BABA-41C7-BEC7-F8E072529F22}"}, function(o){
		 s = ows.getSum(o.ctx,'Points').toFixed(1);
                  $("#jLoadMe1").append(""+s+"");  //control to ensure data is retrieved.

                 return s; 

                 });

}

function BuildGoogleData(sData)
   {
	$("#jLoadMe1").append(BuildGoogleChart(sData));
   }

$(function(){
var xData = GetX();
var yData = GetY();
var cardArr = new Array(xData,yData);
var cardSrt = cardArr.sort();
BuildGoogleData(cardSrt);
}); 
]]>
By: AutoSponge http://www.endusersharepoint.com/2009/05/06/jquery-for-everyone-extending-ows-api-for-calculated-columns/comment-page-1/#comment-13991 AutoSponge Fri, 26 Jun 2009 01:38:37 +0000 http://www.endusersharepoint.com/?p=1611#comment-13991 @Aaron, You're on the right track but you have to call the $.ows for each separate context (list/view). The way you have it, there is no list defined for the second set. I have a dynamic example on my codeplex project at owsapi.codeplex.com. It may help to put the list views on the page, hide them, and pull the guids dynamically. @Aaron,

You’re on the right track but you have to call the $.ows for each separate context (list/view).

The way you have it, there is no list defined for the second set.

I have a dynamic example on my codeplex project at owsapi.codeplex.com. It may help to put the list views on the page, hide them, and pull the guids dynamically.

]]>
By: Aaron http://www.endusersharepoint.com/2009/05/06/jquery-for-everyone-extending-ows-api-for-calculated-columns/comment-page-1/#comment-13988 Aaron Thu, 25 Jun 2009 19:57:26 +0000 http://www.endusersharepoint.com/?p=1611#comment-13988 I realized that I was missing the ListID and the ViewID from the web parts. I was wondering if it is possible to port these in from an array, similar to: (I'm using this to build cross-site google chart api's, trying to aggregate all of the data to one request instead of separate.) <pre lang="javascript" line="1"> $(function(){ var listArr = ['{ctx:"ctx2",list:"{08F609C4-5643-4E7B-B771-CF61E98C9DFA}",view:"{0F6C8393-BABA-41C7-BEC7-F8E072529F22}"}']; $.each(listArr,function(index, ls){ $.fn.ows(ls,function(o){ var s = ows.getSum(o.ctx,'Points').toFixed(1); $("#jChart1").append(BuildGoogleChart(s)); }); }); }); </pre> Using this, it does not appear to pull data, so I'm sure I'm doing something wrong. It does work one site at a time, I'd like to do more so that I could rank the results with an array sort. Thanks, Aaron I realized that I was missing the ListID and the ViewID from the web parts. I was wondering if it is possible to port these in from an array, similar to: (I’m using this to build cross-site google chart api’s, trying to aggregate all of the data to one request instead of separate.)

$(function(){
     var listArr = ['{ctx:"ctx2",list:"{08F609C4-5643-4E7B-B771-CF61E98C9DFA}",view:"{0F6C8393-BABA-41C7-BEC7-F8E072529F22}"}'];

$.each(listArr,function(index, ls){
  $.fn.ows(ls,function(o){
   var s = ows.getSum(o.ctx,'Points').toFixed(1);
   $("#jChart1").append(BuildGoogleChart(s));
	});
   });
});

Using this, it does not appear to pull data, so I’m sure I’m doing something wrong. It does work one site at a time, I’d like to do more so that I could rank the results with an array sort.

Thanks,
Aaron

]]>
By: AutoSponge http://www.endusersharepoint.com/2009/05/06/jquery-for-everyone-extending-ows-api-for-calculated-columns/comment-page-1/#comment-13898 AutoSponge Sun, 21 Jun 2009 23:29:51 +0000 http://www.endusersharepoint.com/?p=1611#comment-13898 @Aaron, If you used the getTable method to find the web part's ID, make sure you set the right context on that too. Check my codeplex project for more examples and updated code: http://owsapi.codeplex.com/ Glad you like it! @Aaron,

If you used the getTable method to find the web part’s ID, make sure you set the right context on that too.

Check my codeplex project for more examples and updated code: http://owsapi.codeplex.com/

Glad you like it!

]]>
By: Aaron http://www.endusersharepoint.com/2009/05/06/jquery-for-everyone-extending-ows-api-for-calculated-columns/comment-page-1/#comment-13896 Aaron Sun, 21 Jun 2009 19:42:37 +0000 http://www.endusersharepoint.com/?p=1611#comment-13896 How could you convert this to work with multiple lists on the same web part page? When I attempted, I changed the CTX default value to select the correct data source but the results still display on the first webpart on the page only. The code is excellent btw! How could you convert this to work with multiple lists on the same web part page? When I attempted, I changed the CTX default value to select the correct data source but the results still display on the first webpart on the page only. The code is excellent btw!

]]>
By: JQuery for Everyone: Email a List of People with OWS | End User SharePoint http://www.endusersharepoint.com/2009/05/06/jquery-for-everyone-extending-ows-api-for-calculated-columns/comment-page-1/#comment-12901 JQuery for Everyone: Email a List of People with OWS | End User SharePoint Sun, 17 May 2009 03:16:29 +0000 http://www.endusersharepoint.com/?p=1611#comment-12901 [...] I needed to upgrade my OWS API with some new functions. I originally used .getValues() to get the values from a field and only [...] [...] I needed to upgrade my OWS API with some new functions. I originally used .getValues() to get the values from a field and only [...]

]]>