| Page 1 of 1 | [ 3 posts ] |
|
Hi,
I am new to the yui datatable. I want yui datatable recordset in json format. I have written following code : var rst1 = myDataTable.getRecordSet().getRecords(); var myJsonString = JSON.stringify(rst1); which gives the output like : [ {"_nCount":0,"_sId":"yui-rec11","_oData": {"UOM_ID":6,"ITEM_DESC":"End Cover","ITEM_CODE":"99149","ITEM_ID":94} }, {"_nCount":4,"_sId":"yui-rec15","_oData": {"UOM_ID":6,"ITEM_DESC":"ValveHousing JT-S","ITEM_CODE":"11204","ITEM_ID":98} } ] and i want the output like : {"data_DB": [ {"UOM_ID":6,"ITEM_DESC":"End Cover","ITEM_CODE":"99149","ITEM_ID":94} ,{"UOM_ID":6,"ITEM_DESC":"End Cover","ITEM_CODE":"99150","ITEM_ID":95} ] } So please tell me how to convert that string to required format. Thanks in advance... |
Alberto SantiniYUI Contributor
|
Hello Rohit.
In YUI 3 (this is a YUI 3 section) it would be: myDataTable.data.toJSON(); You are using YUI 2. Any reason? Hope that helps, IceBox |
|
Thank you Alberto for your reply.
I will use YUI 3 datatable and let you know. |
| Page 1 of 1 | [ 3 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group