added support for hidden columns

This commit is contained in:
Peter Schojer 2008-07-08 12:43:07 +00:00
parent 795601ec64
commit 693db42cee
3 changed files with 23 additions and 0 deletions

View File

@ -490,6 +490,8 @@ void TableRenderer::renderColumn(const Table* pTable, const TableColumn& tc, int
ostr << ",sortable:true";
else
ostr << ",menuDisabled:true";
if (tc.isHidden())
ostr << ",hidden:true";
static TableCellHandlerFactory& fty = TableCellHandlerFactory::instance();

View File

@ -96,6 +96,12 @@ public:
const std::string& getCustomRenderer() const;
/// Returns the custom JavaScript code used to render the values of this column.
/// Empty string if none set
void setHidden(bool hide);
/// Hides/Shows a tablecolumn
bool isHidden() const;
/// Returns the hidden status of the TableColumn
protected:
virtual ~TableColumn();
@ -104,6 +110,7 @@ protected:
private:
Cell::Ptr _pCell;
bool _sortable;
bool _hidden;
std::string _header;
std::string _customRenderer;
};
@ -179,6 +186,18 @@ inline const std::string& TableColumn::getCustomRenderer() const
}
inline void TableColumn::setHidden(bool hide)
{
_hidden = hide;
}
inline bool TableColumn::isHidden() const
{
return _hidden;
}
} } // namespace Poco::WebWidgets

View File

@ -45,6 +45,7 @@ TableColumn::TableColumn(Cell::Ptr pCellFormat):
View(typeid(TableColumn)),
_pCell(pCellFormat),
_sortable(false),
_hidden(false),
_header()
{
if (_pCell)
@ -56,6 +57,7 @@ TableColumn::TableColumn(Cell::Ptr pCellFormat, const std::string& name, int wid
View(typeid(TableColumn)),
_pCell(pCellFormat),
_sortable(sortable),
_hidden(false),
_header(name)
{
setWidth(width);