Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I didn't see all of the information I needed to provide a finite answer. The real magic is the datasource.js file (which you had not provided).</p> <p>I thought an easier way of demonstrating all the necessary pieces would be to put together a JSFiddle showing your data in use and all the pieces that were necessary.</p> <p><a href="http://jsfiddle.net/bdeanet/WMHcu/">Link to JSFiddle of Fuel UX Datagrid sample with your data</a></p> <p>Adam Alexander, the author of the tool, also has written a valuable example of using the dataGrid <a href="http://dailyjs.com/2012/10/29/fuel-ux/">DailyJS Fuel UX DataGrid</a></p> <pre><code>// DataSource Constructor var StaticDataSource = function( options ) { this._columns = options.columns; this._formatter = options.formatter; this._data = options.data; this._delay = options.delay; }; StaticDataSource.prototype = { columns: function() { return this._columns }, data: function( options, callback ) { var self = this; var data = $.extend(true, [], self._data); // SEARCHING if (options.search) { data = _.filter(data, function (item) { for (var prop in item) { if (!item.hasOwnProperty(prop)) continue; if (~item[prop].toString().toLowerCase().indexOf(options.search.toLowerCase())) return true; } return false; }); } var count = data.length; // SORTING if (options.sortProperty) { data = _.sortBy(data, options.sortProperty); if (options.sortDirection === 'desc') data.reverse(); } // PAGING var startIndex = options.pageIndex * options.pageSize; var endIndex = startIndex + options.pageSize; var end = (endIndex &gt; count) ? count : endIndex; var pages = Math.ceil(count / options.pageSize); var page = options.pageIndex + 1; var start = startIndex + 1; data = data.slice(startIndex, endIndex); if (self._formatter) self._formatter(data); callback({ data: data, start: 0, end: 0, count: 0, pages: 0, page: 0 }); } }; </code></pre> <p>If you were to provide your markup and what your "datasource.js" file contains, I may be able to help you further.</p> <p>I think the demonstration provides much information on any pieces you may not have understood.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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