Stack Exchange
How to set json data into ajax response
I want to set ajax response data in dropdown.my demo code for ajax call is below.
function  onChangeajax(e)
    {
        griddataObj = $('#ObjectAccountConfiguration').data("kendoGrid");
        accountID = e.container.find(":input[name=AccountID]");
        accountIDdropdown = accountID.data("kendoDropDownList");
        var x = contactType.val();
        var y = accountType.val();
        var z = LedgerType.val();
        var a = contactGroupID.val();

        $.ajax
        ({
          type:'post', 
          data: { 'x': x, 'y': y, 'z': z, 'a': a },
          url : '<?php echo $this->Html->url(array("controller"=>"ObjectTypes/getAccount")); ?>',
          success: function(data)
          {

          }
        });
    }

In ajax response i get 
{"data":[{"value":"87","text":"Expense"}]}

Now how to set this data in ajax sucess??

Try this this will alert your select box. Further you can use var str to display on your page    
function  onChangeajax(e)
        {
            griddataObj = $('#ObjectAccountConfiguration').data("kendoGrid");
            accountID = e.container.find(":input[name=AccountID]");
            accountIDdropdown = accountID.data("kendoDropDownList");
            var x = contactType.val();
            var y = accountType.val();
            var z = LedgerType.val();
            var a = contactGroupID.val();
            var str='<select name="account">';

            $.ajax
            ({
              type:'post', 
              data: { 'x': x, 'y': y, 'z': z, 'a': a },
              url : '<?php echo $this->Html->url(array("controller"=>"ObjectTypes/getAccount")); ?>',
              success: function(data)
              {
                $.each(data[data],function(key,val){
                   str+='<option value="'+val['value']+'">'+val['text']+'</option>';

                   });
                str+='</select>';
                alert(str);
              }
            });
        }


But How to set data in accountID dropdown??

As you are showing that this is the response data from the ajax, let me tell, Is value is account id? {"data":[{"value":"87","text":"Expense"}]}

I use onChangeajax function from one dropdown and i want to set this response array values in account drodown.accountID = e.container.find(":input[name=AccountID]");
accountIDdropdown = accountID.data("kendoDropDownList");

I want to set my response into account dropdown.

Listen you have this data {"data":[{"value":"87","text":"Expense"}]}  as response right. Now you want this response data in dropdown like <select name='account'><option value='87'>Expense</option></select> am i right?

yes sir,but i use kendoui dropdown control into kendoui inline grid.

the 'success' parameter of $.ajax is a function that is called after the AJAX response is received from the server. It has 3 parameters, data, textStatus and  jqXHR.
textStatus and jqXHR are more useful for assessing whether the response is valid and is what you expected to get, while data is the response.
In your case, since your response is 
{"data":[{"value":"87","text":"Expense"}]}

data.data.value is equal to 87. Inside the function, you can use that value for whatever you want.
Understand? 

How to set value in account Dropdown?

you'll need to find the dropdown again (the context is different) and modify whatever you want..
