improved DND on table

This commit is contained in:
Peter Schojer 2008-07-02 06:09:09 +00:00
parent 91676683db
commit 359ef99f85
2 changed files with 11 additions and 1 deletions

View File

@ -125,6 +125,9 @@ public:
/// Adds a javascript callback to inform the WebServer that the client has pressed a mouse button
/// Method signature is ( Ext.EventObject e)
static std::string createDnDGroupName(const Table* pTable);
/// Creates a DND name for the table
protected:
static void renderProperties(const Table* pTable, const RenderContext& context, std::ostream& ostr);
/// Renders Table properties

View File

@ -329,7 +329,7 @@ void TableRenderer::renderProperties(const Table* pTable, const RenderContext& c
// sorting is allowed though, i.e row matching is active
ostr << ",clicksToEdit:1,stripeRows:true,enableColumnHide:false,enableColumnMove:false,loadMask:true";
if (pTable->getDragAndDrop())
ostr << ",enableDragDrop:true";
ostr << ",enableDragDrop:true,ddGroup:'" << createDnDGroupName(pTable) << "'";
if (pTable->getSelectionModel() != Table::SM_CELL)
{
@ -407,6 +407,13 @@ void TableRenderer::renderProperties(const Table* pTable, const RenderContext& c
}
std::string TableRenderer::createDnDGroupName(const Table* pTable)
{
poco_check_ptr (pTable);
return "ddgrid" + Poco::NumberFormatter::format(pTable->id());
}
void TableRenderer::renderColumns(const Table* pTable, const RenderContext& context, std::ostream& ostr)
{