Project

General

Profile

Bug #3198

WSortFilterProxyModel does not filter

Added by Anonymous over 8 years ago. Updated over 8 years ago.

Status:
Feedback
Priority:
Normal
Assignee:
Target version:
-
Start date:
05/24/2014
Due date:
% Done:

0%

Estimated time:

Description

I have a WTableView object connected to a model object of type WSortFilterModel which in turn is connected to an object of type WStandardItemModel. The tableview initially renders the data just fine. But when I try to filter, however, the data disappears from the tableview. Relevant code is below (I use a WTextEdit to input filter data and a WPushButton to trigger the filter on column 5 of in my model):

construction and initialization of filter model:

m_filter_model = new Wt::WSortFilterProxyModel(root())

m_filter_model->setSourceModel(m_orders_model);

m_filter_model->setDynamicSortFilter(true);

m_filter_model->setFilterRole(Wt::UserRole); /// btw, i also tried the DisplayRole. same behaviour.

Here I trigger the filter but the data in the view disappears:

void button_clicked()

{

m_filter_model->setFilterKeyColumn(5);

m_filter_model~~setFilterRegExp(m_filterEdit~~>text()); // I checked to make sure there is indeed the correct filter text.

}

Help is appreciated,

Thanks

suresh


Files

Before.PNG (32.4 KB) Before.PNG Suresh Easwar, 05/28/2014 05:51 PM
After.PNG (20.5 KB) After.PNG Suresh Easwar, 05/28/2014 05:51 PM

Also available in: Atom PDF