Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Button filter handler

    Hello,

    (I'm sorry for my english)

    I have an application which shows a list of customers. I have some methods which use RPC to get a Data Transfer Object list from my server. On client-side, DTOs are converted into records and I use the setData method of my ListGrid to print cutomers.

    I have to transform my grid on paginated grid. I think do that with Criteria and fetchData method. When user sorts or filters the grid I would like execute this code:

    Code:
    Criteria cri = new Criteria();
        cri.setAttribute("sortField", getSortField());
        cri.setAttribute("sortDirection", getSortDirection());
        
        // for each filtered fields
        // cri.addCriteria(field, value);
    
        fetchData(cri);
    My problem is that my fetchData method is never asked (when I sort grid or when I filter)

    How can I handler sort and filter button? Which method is called when I click on filter button?

    #2
    Clicking the filter editor buttong will call ListGrid.filterData()
    Clicking the sort button calls ListGrid.sortData()

    If you want to catch all the fetch requests and modify them before sending them to the server you might want to consider implementing an override at the DataSource level - for example to DataSource.fetchData() or (if you're not using the SmartClient server) DataSource.transformRequest()

    Comment

    Working...
    X