1

Closed

GridRenderer should allow for body start and end

description

Please add support for start and end of the item set in the GridRenderer, so that the HtmlTableGridRenderer can render the <tbody> tag.

I was able to implement this by modifying the GridRenderer.RenderItems() method like so:

protected virtual void RenderItems()
{
RenderBodyStart();

bool isAlternate = false;
foreach(var item in DataSource)
{
    RenderItem(new GridRowViewData<T>(item, isAlternate));
    isAlternate = !isAlternate;
}

RenderBodyEnd();
}

And making the following additions:

To GridRenderer:
    protected abstract void RenderBodyStart();
    protected abstract void RenderBodyEnd();
To HtmlTableGridRenderer:
    protected override void RenderBodyStart()
    {
        RenderText("<tbody>");
    }

    protected override void RenderBodyEnd()
    {
        RenderText("</tbody>");
    }
Closed Mar 29, 2009 at 11:53 AM by
Fixed in revision 920

comments

paulwhit wrote Mar 28, 2009 at 12:34 AM

This was important to get the grid working as a jQuery datatable.