ksd wrote:
> Hi,
>
> I am running Simle Exhibit 2.0 via a web server (Perl-Catalyst-TT) and
> dynamically generating both the JSON files and the HTML (template).
>
> There are cases where users are sent an empty set of JSON items. For
> example, zero search results.
>
> I structure the response such that the HTML template is created first
> without the search being completed or number of results being known.
> After this, the users browser asks for the JSON file, which is
> dynamically generated - which is when the query is run and number of
> resulting items is computed.
>
> The problem is when there are zero "items", the div (exhibit-
> collectionView-header) stating there were no results, is not shown..
> specifically: "exhibit-collectionSummaryWidget-results". Neither are
> the table headers (I am using Tabular view) visible.
>
> Is there are way to require exhibit-collectionSummary-Widget-results
> to be shown even if there are zero items?
>
Kutbuddin,
Take a look in
http://api.simile-widgets.org/exhibit/2.2.0/scripts/ui/widgets/collection-summary-widget.js
Find
Exhibit.CollectionSummaryWidget.prototype._reconstruct
You need to make a copy of that function and include it after you
include exhibit-api.js in order to override the default behavior. Then
remove the check for originalSize > 0. That check causes the summary
widget to be empty when there is no item at all.
> Is there are way to force TH for the customized viewClass="Tabular"
> even when items are empty?
>
> All this works greats when via a filter you get zero selected items. I
> want the case to look very similar when there are just zero items in
> the JSON file.
>
This is in
http://api.simile-widgets.org/exhibit/2.2.0/scripts/ui/views/tabular-view.js
Look for
Exhibit.TabularView.prototype._reconstruct
Make a copy of that function. Note the check items.length > 0. The
second comment in that if statement is wrong: it should say "Create
table" rather than "Sort the items". Move the chunks of code that create
the table and create the column headers outside the if statement.
David
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SIMILE Widgets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/simile-widgets?hl=en
-~----------~----~----~----~------~----~------~--~---