JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://cdn.kendostatic.com/2012.2.913/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.2.913/styles/kendo.mobile.all.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.2.913/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2012.2.913/styles/kendo.default.min.css">
<div id="grid"></div>
JavaScript
var products = [{
"ProductID": 1,
"ProductName": "Chai",
"WhiteLabelID": 1,
"UnitPrice": "18.00"
},
{
"ProductID": 2,
"ProductName": "Chang",
"WhiteLabelID": 1,
"UnitPrice": "19.00"
},
{
"ProductID": 3,
"ProductName": "Aniseed Syrup",
"WhiteLabelID": 2,
"UnitPrice": "10.00"
},
{
"ProductID": 4,
"ProductName": "Chef Anton's Cajun Seasoning",
"WhiteLabelID": 2,
"UnitPrice": "22.00"
},
{
"ProductID": 5,
"ProductName": "Chef Anton's Gumbo Mix",
"WhiteLabelID": 2,
"UnitPrice": "21.35"
},
{
"ProductID": 6,
"ProductName": "Grandma's Boysenberry Spread",
"WhiteLabelID": 2,
"UnitPrice": "25.00"
}];
var categories = null;
$.ajax(
{
type: "POST",
url: serviceUrlHelper.merchantadmin + "/GetWhiteLabelIdAndName",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
processData: false,
success: function (data)
{
for (var i = 0; i < data.length; i++)
{
delete data[i].ExtensionData;
}
alert(JSON.stringify(data));
categories = JSON.stringify(data);
// categories = categories.replace(/Text/gi, "text");
// categories = categories.replace(/Value/gi, "value")
alert(categories);
},
error: function (XMLHttpRequest, textStatus, errorThrown)
{
var err = eval("(" + XMLHttpRequest.responseText + ")");
},
async: false
}
)
// var categories = [{ "text": "Famila System", "value": 5 }, { "text": "test", "value": 7 }, { "text": "rest", "value": 8 }, { "text": "rest1", "value": 9}]
// var categories = [{
// "value": 1,
...