jQuery UI Widgets › Forums › Grid › Array in cell grid
Tagged: angular grid, array, Cell, grid, jquery grid, jqxgrid, load, value
This topic contains 2 replies, has 2 voices, and was last updated by wUser 9 years, 5 months ago.
Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorArray in cell grid Posts
-
Hello,
how to show an arrays into cell grid?
thx.
Hello wUser,
Here is how to load an array in a grid cell:
<!DOCTYPE html> <html lang="en"> <head> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.11.1.min.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxgrid.columnsresize.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script> <script type="text/javascript" src="../../scripts/demos.js"></script> <script type="text/javascript"> $(document).ready(function () { var sampleData = [{ name: 'John', jobs: ['Programmer', 'Manager'] }, { name: 'Clara', jobs: ['Teacher', 'Caretaker', 'Barmaid']}]; var source = { datatype: "json", datafields: [ { name: 'name', type: 'string' }, { name: 'jobs', type: 'array' } ], localdata: sampleData }; var dataAdapter = new $.jqx.dataAdapter(source); $("#jqxgrid").jqxGrid( { width: 850, source: dataAdapter, columnsresize: true, columns: [ { text: 'Name', datafield: 'name', width: 250 }, { text: 'Jobs', datafield: 'jobs', width: 250 } ] }); }); </script> </head> <body class='default'> <div id="jqxgrid"> </div> </body> </html>
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/thank you very match Dimitar
-
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.