SPJS Chart v6 : Custom Filter

Forums SPJS Charts for SharePoint SPJS Chart v6 : Custom Filter

Viewing 1 reply thread
  • Author
    Posts
    • #14303
      Jhap
      Participant

      Hi Sir Alexander.

      I have this filter in v5. How can I format this in v6 please?

      function spjs_getFilterValue(list,field){
      	var q = "<Where><IsNotNull><FieldRef Name='ID' /></IsNotNull></Where><OrderBy><FieldRef Name='"+field+"' Ascending='FALSE' /></OrderBy>";
      	var res = spjs.charts.qItems({"listName":list,"query":q,"viewFields":[field]});
      	var b = [];
      	var fObj = {};
      	$.each(res.items,function(i,item){
      		if(fObj[item[field]] === undefined){
      			fObj[item[field]] = 1;
      			if(item[field].split(";#").length > 1){
      			item[field] = item[field].split(";#")[1];
      		}
      			b.push({"f":""+item[field]+"","v":""+item[field]});
      		}
      	});
      	return b;
      }
      var myCustomFilterOptions = spjs_getFilterValue("{387E5BB7-EE04-4496-8B77-186EE736321B}","Month");

      Thank you very much.

      • This topic was modified 7 years, 4 months ago by Jhap.
    • #14337
      Alexander Bautz
      Keymaster

      Hi,
      Sorry for the delay – You should find some info in the user manual.

      Alexander

Viewing 1 reply thread
  • You must be logged in to reply to this topic.