Simile Exhibit

Simile Exhibit

yee379yee379 Posts: 6Questions: 0Answers: 0
edited November 2011 in General
Hi, i currently have a project where i use Simile's Exhibit

[quote] http://www.simile-widgets.org/exhibit/ [/quote]

to tabulate data. i like it mainly due to its ability to quickly present and filter data. i would like to migrate to DataTables, but my data format may be a little difficult to import into DataTables:

- data is currently fetched via jsonp
- the general format of the json contains elements which are arrays; eg

[code]
{
"items": [
{
"label": "item 1",
"field1": "value 1",
"field2": [ "one", "two" ]
},
{
"label": "item 2",
"field1": "value 2",
"field2": [ "two", "three" ]
}
]
}
[/code]

in terms of functionality of exhibit:

- exhibit has something they called 'facets' which will provide a list of values for each field; so from the above data structure the facet for field1 will be value 1 and value 2; the facet for field2 will be one, two and three.
- the facets also provide a simple population count; so field2 will have one=1, two=2 and three=1.
- selecting a specific facet value will filter the table dynamically to only contain matching rows. multiple facets can be used to further refine the table contents.
- the display of "field2" on the actual table will be comma separated.

i think i can get basic functionality using the

[quote] http://www.datatables.net/release-datatables/examples/api/multi_filter_select.html [/quote]

example, however, i was wondering if anyone has had a go at expressing the select as a 1d table and making that toggle-able so that it can do the dynamic filtering.

as for jsonp and accepting the different data structure (and more importantly accepting the array data), how would i go about getting datatable to read the data without reformatting at the server side?

thanks!

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    Getting your JSON data into DataTables is no problem at all. You just need to use the mDataProp options for each column to tell it what data you want that column to display: http://datatables.net/blog/Extended_data_source_options_with_DataTables .

    There are also multiple filtering options for DataTables: http://datatables.net/development/filtering . Which one is best, will depend a little bit on how you want the filtering to operate. If you just was string matching then the built in fnFilter function will do the job nicely.

    Allan
This discussion has been closed.