如何绑定动态数组值? [英] How to bind Dynamically Array value ?

查看:60
本文介绍了如何绑定动态数组值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我想在高图表中动态获取数组值,

我创建了以下代码,在这里我从SharePoint列表中检索值,并根据该值我需要开发一个图,那么我该怎么做?

所以请帮我提供任何答案...

Hello ,

I want to take dynamically array value in High chart,

I have created following code , Here I am retrieving value from SharePoint list And according to that values I need to develop a graph So what I can do for That?

So Please help provide me any answer...

 ........Something Code above.......
    $().SPServices({
                operation: method,
                async: false,  //if you set this to true, you may get faster performance, but your order may not be accurate.
                listName: list,
                CAMLViewFields: fieldsToRead,
                  CAMLQuery: query,
                      //this basically means "do the following code when the call is complete"
                    completefunc: function (xData, Status) { 
                        //this code iterates through every row of data returned from the web service call
                        $(xData.responseXML).SPFilterNode("z:row").each(function() { 
    var Name = ($(this).attr("ows_Title"));
 var Salary = ($(this).attr("ows_Salary"));
 var iID=$(this).attr("ows_ID");
                         
                       
                            //call a function to add the data from the row to a table on the screen
                            AddRowToTable(Name ,Salary ,iID);
                            
                            
                            
                        });                
                    }
        });

}
 function AddRowToTable(Name ,Salary ,iID)
     {

         alert(Salary);
         
          $.getJSON("arr", function AddRowToTable(Name ,Salary ,iID) {
        $('#courseTable').highcharts({
           title: {
             text: 'Monthly Average Salary',
              x: -20 //center
           },
            subtitle: {
               text: '',
               x: -20
            },
            xAxis: {
               categories:[''+Name+'']
                         },
            yAxis: {
            
                       
              title: {
                  text: 'Salary (RS)'
                },
                
                    plotLines: [{
                  
                    value: 0,
                    width: 1,
                   color: '#808080'
               }]
               
             

            },
            tooltip: {
                valueSuffix: 'Rs'
            },
            
          
            legend: {
                layout: 'vertical',
                align: 'right',
                verticalAlign: 'middle',
               borderWidth: 1
            },
            
            series: [{
                             
              name: [''+Name+''],
              data: JSON.parse("[" + Salary+ "]") 
                    
                     }]
       });
       });
    };

</script>



请使用代码格式.谢谢你. Maciej Los [/EDIT]



Please, use code formatting. Thank you. Maciej Los[/EDIT]

推荐答案

().SPServices({ 操作:方法, 异步:如果将其设置为true,则 false // ,您可能会获得更快的性能,但您的订单可能不准确. listName:列表, CAMLViewFields:fieldsToRead, CAMLQuery:查询, // 这基本上意味着在通话完成后执行以下代码" completefunc:函数(xData,状态){ // 此代码遍历从Web服务调用返回的每一行数据
().SPServices({ operation: method, async: false, //if you set this to true, you may get faster performance, but your order may not be accurate. listName: list, CAMLViewFields: fieldsToRead, CAMLQuery: query, //this basically means "do the following code when the call is complete" completefunc: function (xData, Status) { //this code iterates through every row of data returned from the web service call


(xData.responseXML).SPFilterNode(" ).each( 功能(){ var 名称=(
(xData.responseXML).SPFilterNode("z:row").each(function() { var Name = (


( this ).attr(" )); var 工资=(
(this).attr("ows_Title")); var Salary = (


这篇关于如何绑定动态数组值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆