Hi. Thanks for the reply.
I want to display the text of the button.
Here is the json i am using:
{"items":[{"isGiftWrap":"N","giftWrapCharge":0,"stockQuantity":580,"itemValue":"Black","save":93,"maxShippingDays":2,"minShippingDays":2,"maxOrderableQty":5,"sellingPrice":420,"mrp":6200,"basePrice":400.0,"mobileImage":false,"largeImageList":[],"mediumImageList":[],"itemId":33614551,"itemName":"Samsung Galaxy Grand Quattro (Win Duos) I8552 Dual SIM Android Mobile Phone Testcatno25-Black"},{"isGiftWrap":"N","giftWrapCharge":0,"stockQuantity":489,"itemValue":"White","save":54,"maxShippingDays":2,"minShippingDays":2,"maxOrderableQty":5,"sellingPrice":1126,"mrp":2500,"basePrice":1001.0,"mobileImage":false,"largeImageList":[],"mediumImageList":[],"itemId":33614552,"itemName":"Samsung Galaxy Grand Quattro (Win Duos) I8552 Dual SIM Android Mobile Phone Testcatno25-White"},{"isGiftWrap":"N","giftWrapCharge":0,"stockQuantity":1196,"itemValue":"Brown","save":88,"maxShippingDays":2,"minShippingDays":2,"maxOrderableQty":1,"sellingPrice":466,"mrp":3999,"basePrice":444.0,"mobileImage":false,"largeImageList":[],"mediumImageList":[],"itemId":33614776,"itemName":"Samsung Galaxy Grand Quattro (Win Duos) I8552 Dual SIM Android Mobile Phone Testcatno25-Brown"},{"isGiftWrap":"N","giftWrapCharge":0,"stockQuantity":1196,"itemValue":"Brown","save":88,"maxShippingDays":2,"minShippingDays":2,"maxOrderableQty":1,"sellingPrice":466,"mrp":3999,"basePrice":444.0,"mobileImage":false,"largeImageList":[],"mediumImageList":[],"itemId":33614777,"itemName":"Samsung Galaxy Grand Quattro (Win Duos) I8552 Dual SIM Android Mobile Phone Testcatno25-Brown"},{"isGiftWrap":"N","giftWrapCharge":0,"stockQuantity":1196,"itemValue":"Brown","save":88,"maxShippingDays":2,"minShippingDays":2,"maxOrderableQty":1,"sellingPrice":466,"mrp":3999,"basePrice":444.0,"mobileImage":false,"largeImageList":[],"mediumImageList":[],"itemId":33614778,"itemName":"Samsung Galaxy Grand Quattro (Win Duos) I8552 Dual SIM Android Mobile Phone Testcatno25-Brown"},{"isGiftWrap":"N","giftWrapCharge":0,"stockQuantity":0,"itemValue":"Grey","save":22,"maxShippingDays":2,"minShippingDays":2,"maxOrderableQty":1,"sellingPrice":14280,"mrp":18365,"basePrice":13600.0,"mobileImage":false,"largeImageList":[],"mediumImageList":[],"itemId":33614783,"itemName":"Samsung Galaxy Grand Quattro (Win Duos) I8552 Dual SIM Android Mobile Phone Testcatno25-Grey"}]}
And here is my UI code
<ul data-bind="foreach: items">
<li><span data-bind="text: itemValue"></span>
<button
data-bind="click: buttonClick, text: buttonText($data)"></button>
</li>
</ul>
I want to display itemValue i.e. black or brown on UI as button text.
Please use json parser
https://www.jsoneditoronline.org/ for making the json to make some sense :)