mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-14 02:57:45 +01:00
added support for hidden columns
This commit is contained in:
parent
795601ec64
commit
693db42cee
@ -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();
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user