Note that there are some explanatory texts on larger screens.

plurals
  1. POFuelUX datagrid not loading (using example)
    text
    copied!<p>I'm new to FuelUX so I was trying to get this to work, based on the example provided:</p> <pre><code>require(['jquery','data.js', 'datasource.js', 'fuelux/all'], function ($, sampleData, StaticDataSource) { var dataSource = new StaticDataSource({ columns: [{property:"memberid",label:"LidId",sortable:true},{property:"name",label:"Naam",sortable:true},{property:"age",label:"Leeftijd",sortable:true}], data: sampleData.memberdata, delay: 250 }); $('#MyGrid').datagrid({ dataSource: dataSource, stretchHeight: true }); }); }); </code></pre> <p>With this as the data:</p> <pre><code>(function (root, factory) { if (typeof define === 'function' &amp;&amp; define.amd) { define(factory); } else { root.sampleData = factory(); } }(this, function () { return { "memberdata": [{ "memberid": 103, "name": "Laurens Natzijl", "age": "25" }, { "memberid": 104, "name": "Sandra Snoek", "age": "25" }, { "memberid": 105, "name": "Jacob Kort", "age": "25" }, { "memberid": 106, "name": "Erik Blokker", "age": "25" }, { "memberid": 107, "name": "Jacco Ruigewaard", "age":"25" },{ /* etc */ }] } })); </code></pre> <p>I've got no console errors, no missing includes. Everthing works just fine - it even looks like it's loading. Except nothing shows up in the datagrid but '0 items'.</p> <p>Any suggestions? I think I did everything the example provided...</p> <p>EDIT: 14:33 (Amsterdam) There seems to be a difference when I put this in console:</p> <p><strong>My page:</strong></p> <pre><code>require(['jquery','data.js','datasource.js', 'fuelux/all'], function ($, sampleData, StaticDataSource) { var dataSource = new StaticDataSource({ columns: [{property:"memberid",label:"LidId",sortable:true},{property:"name",label:"Naam",sortable:true},{property:"age",label:"Leeftijd",sortable:true}], data: sampleData.memberdata, delay: 250 }); console.debug(dataSource); }); </code></pre> <p>1st row in console:</p> <pre><code>function localRequire(deps, callback, errback) { /* etc */ } </code></pre> <p>2nd row in console:</p> <pre><code>StaticDataSource {_formatter: undefined, _columns: Array[3], _delay: 250, _data: Array[25], columns: function…} </code></pre> <p><strong>FuelUX Example:</strong></p> <pre><code>require(['jquery', 'sample/data', 'sample/datasource', 'sample/datasourceTree', 'fuelux/all'], function ($, sampleData, StaticDataSource, DataSourceTree) { var dataSource = new StaticDataSource({ columns: [{property: 'toponymName',label: 'Name',sortable: true}, {property: 'countrycode',label: 'Country',sortable: true}, {property: 'population',label: 'Population',sortable: true}, {property: 'fcodeName',label: 'Type',sortable: true}], data: sampleData.geonames, delay: 250 }); console.debug(dataSource); }); </code></pre> <p>1st row in console:</p> <pre><code>StaticDataSource {_formatter: undefined, _columns: Array[4], _delay: 250, _data: Array[146], columns: function…} </code></pre> <p>2nd row in console:</p> <pre><code>function (deps, callback, errback, relMap) { /* etc */ } </code></pre> <p>Maybe this will help you help me :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload