more Table events

This commit is contained in:
Peter Schojer
2008-06-27 09:58:27 +00:00
parent 3ca6a9775c
commit e0bb9c162b
4 changed files with 101 additions and 3 deletions

View File

@@ -49,7 +49,9 @@ const std::string Table::FIELD_ROW("row");
const std::string Table::FIELD_VAL("val");
const std::string Table::FIELD_CNT("cnt");
const std::string Table::EV_CELLCLICKED("click");
const std::string Table::EV_BEFORECELLCLICKED("beforeclick");
const std::string Table::EV_ROWCLICKED("row");
const std::string Table::EV_BEFOREROWCLICKED("beforerow");
const std::string Table::EV_CELLVALUECHANGED("edit");
const std::string Table::EV_LOADDATA("load");
const std::string Table::EV_AFTERLOAD("afterload");
@@ -169,6 +171,15 @@ void Table::handleAjaxRequest(const Poco::Net::NameValueCollection& args, Poco::
cellClicked(this, ev);
response.send();
}
else if (ev == EV_BEFORECELLCLICKED)
{
if (col < 0 || row < 0 || col >= getColumnCount())
throw InvalidArgumentException("col/row out of range");
CellClick ev(row, col);
beforeCellClicked(this, ev);
response.send();
}
else if (ev == EV_ROWCLICKED)
{
if (row < 0 )
@@ -178,6 +189,15 @@ void Table::handleAjaxRequest(const Poco::Net::NameValueCollection& args, Poco::
rowClicked(this, theRow);
response.send();
}
else if (ev == EV_BEFOREROWCLICKED)
{
if (row < 0 )
throw InvalidArgumentException("row out of range");
std::size_t theRow(row);
beforeRowClicked(this, theRow);
response.send();
}
else if (ev == EV_CELLVALUECHANGED)
{
if (col < 0 || row < 0 || col >= getColumnCount())