mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-14 15:05:35 +02:00
added support for custom JS cell renderers
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user