It's so easy, just think about another way. You are sending data from the server as a JSON response, instead of that use that send a String/Variable and use that in your view directly. You have to use your Result array(in controller to generate the sring).
For example:-
Consider $Items-->Is your result array.
foreach($items as item)
{
$dataSource='[
{ text: "Furniture", expanded: true, items: [
{ text: "Tables & Chairs" },
{ text: "Sofas" },
{ text: "Occasional Furniture" }
] },
{ text: "Decor", items: [
{ text: "Bed Linen" },
{ text: "Curtains & Blinds" },
{ text: "Carpets" }
] }
]';
}
Better you use a recursive function to get the string and save that string to data source variable.
If still this is not clear to you then let me know, I will clearly write some block of code for you.