dlcohen1 wrote:
> 2/12/07
>
> In Exhibit, is there a way to have the numbers of the items appear in 
> the table as they do in the tiles?  In other words, I would like a 
> table have row numbers (1, 2, 3, etc.) automatically placed to the 
> left of each row and have the numbers appear automatically after every 
> sort showing the numerical order and placement of each row.  Thank you.
Right now we don't support that. But you could potentially override 
Exhibit to achieve what you want, if that's strongly desired. In

    http://static.simile.mit.edu/exhibit/api/scripts/views/tabular-view.js

find Exhibit.TabularView.prototype._reconstruct. In that function, where 
it says

    var results = column.expression.evaluate(
        { "value" : item.id },
        { "value" : "item" },
        "value",
        database
    );

You need to change it to

    var results = column.expression.evaluate(
        { "value" : item.id, "rowIndex" : i + 1 },
        { "value" : "item", "rowIndex" : "number" },
        "value",
        database
    );

To do this, you need to copy that whole function and paste it in 
<script>...</script> after you include exhibit-api.js, and make a change 
within that copy. Then in your TabularView, specify "rowIndex" as one of 
the element in ex:columns.

(We'll support that by default in the next release of Exhibit.)

David

_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general

Reply via email to