added support for custom JS cell renderers

This commit is contained in:
Peter Schojer
2008-06-09 13:28:59 +00:00
parent 46ab108194
commit b3d124f14a
4 changed files with 37 additions and 5 deletions

View File

@@ -41,6 +41,7 @@
#include "Poco/WebWidgets/LookAndFeel.h"
#include "Poco/WebWidgets/WebApplication.h"
#include "Poco/WebWidgets/RequestHandler.h"
#include "Poco/NumberFormatter.h"
namespace Poco {
@@ -71,8 +72,11 @@ void PageRenderer::renderHead(const Renderable* pRenderable, const RenderContext
static const std::string STRC_TITLE ("</title>");
poco_assert_dbg (pRenderable != 0);
poco_assert_dbg (pRenderable->type() == typeid(Poco::WebWidgets::Page));
const Page* pPage = static_cast<const Poco::WebWidgets::Page*>(pRenderable);
poco_assert_dbg (WebApplication::instance().getCurrentPage().get() == pPage);
Page* pPage = const_cast<Page*>(static_cast<const Poco::WebWidgets::Page*>(pRenderable));
pPage->pageRequested.notify(this, pPage);
poco_assert_dbg (context.application().getCurrentPage().get() == pPage);
const LookAndFeel& laf = context.lookAndFeel();
ResourceManager::Ptr pRM = context.application().getResourceManager();
@@ -173,7 +177,7 @@ void PageRenderer::renderHead(const Renderable* pRenderable, const RenderContext
}
ostr << STRC_HEAD;
WebApplication::instance().registerAjaxProcessor(Poco::NumberFormatter::format(pPage->id()), pPage);
}

View File

@@ -295,8 +295,11 @@ void TableRenderer::renderColumn(const Table* pTable, const TableColumn& tc, int
ostr << ",editor:";
tc.getCell()->renderHead(context, ostr);
}
if (pHandler->useRenderer())
if (!tc.getCustomRenderer().empty())
{
ostr << ",renderer:" << tc.getCustomRenderer();
}
else if (pHandler->useRenderer())
{
ostr << ",renderer:";
pHandler->writeDynamicData(ostr);