Project

General

Profile

Actions

Support #1355

open

misc questions - dbo, treeview, model

Added by navnidhi sharma almost 12 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
07/11/2012
Due date:
% Done:

0%

Estimated time:

Description

1) First, the data is not collapsing as cited on the website http://www.webtoolkit.eu/widgets/mvc-widgets/wtreeview#/mvc-widgets/the-models-

Wt::WStandardItemModel *model = new Wt::WStandardItemModel(0, 0, root);

WTreeView *treeView = new WTreeView(w);

treeView->setMargin(10, Top | Bottom);

treeView->setMargin(WLength::Auto, Left | Right);

treeView->setModel(model);

treeView->setSortingEnabled(true);

treeView->setColumnResizeEnabled(true);

treeView->setSelectionMode(SingleSelection);

treeView->setAlternatingRowColors(true);

treeView->setColumnAlignment(0, AlignCenter);

treeView->setHeaderAlignment(0, AlignCenter);

treeView->setRowHeight(22);

2) Second, I am using dbo and would like to get the data from the two tables- e.g. X and Y. So, far I am using boost::tuple to get the data. Since it has a limit 10, I cannot use it anymore. do you have a way to do so?

//the following is limited to 10

typedef boost::tuple<std::string, std::string, std::string, double, double, double, double, double, double> DATE_TUPLE;

typedef std::vector ITEMS;

ITEMS asnwer;

std::string query = "SELECT x.grp_key, x.key, x.name, x.ref, x.prc, x.qty, y.qty, y.prc, x.vol FROM ";

query += exchange*.get_mutable_instance().dbUtil*.getTblName();

query += \" x LEFT OUTER JOIN ";

query += exchange*.get_mutable_instance().dbUtil*.getTblName();

query += " y ON x.key = y.ins_key ";

query += "GROUP BY x.grp_key, x.name\";

if(!dbUtil_.queryDB( query, asnwer)) return NULL;

3) Do i just need to apply a new data/change to the model and it will result automatically in the tableview/treeview or I need to do it myself and reload the model again.

Your help is appreciated.

Thank you

Navnidhi

No data to display

Actions

Also available in: Atom PDF