|
Title: Dynamic columns Post by: Pierre on May 31, 2013, 08:20:15 AM Hi all
I need to create datagrid columns "on the fly". Here is what I have: Code: $.get("/json/members_tabs.json",my "data" contain same value as above, but it does not work. Why not? I mean, if I use this: columns: data and inside "data" is this: [[{field:"_date",title:"Date"},{field:"document",title:"Name"},{field:"shipping",title:"Price",align:"right"}]] it will not work, and if I use this: columns: [[{field:"_date",title:"Date"},{field:"document",title:"Name"},{field:"shipping",title:"Price",align:"right"}]] it works. What I need to do so I can create columns on the fly? I found this answer: http://www.jeasyui.com/forum/index.php?topic=286.msg681#msg681 but it is same as above - If I use my data instead od "hardcoded" values - it does not work. Thanks for help. Title: Re: Dynamic columns Post by: stworthy on June 01, 2013, 08:49:51 AM Please check the data returned from '/json/members_tabs.json' to see if it is correct. Here is the example that create columns dynamically.
http://jsfiddle.net/H5rkg/ Title: Re: Dynamic columns Post by: Pierre on June 01, 2013, 01:11:34 PM Thank you for your solution, thanks a lot.
|