简体   繁体   中英

Dojo Gridx programattic refresh shows no data

I am trying to create a programmatic filter. I have a dijit.tree and a dojo gridx using the same source on a jsp. When user clicks the tree node, I want to use the node as a filter and show all rows matching it in the gridx

This is my code I have now for the onClick event of the dijit tree node.

                    var global=this;
                    treeWidget.onClick = function(item){

          global.grid.filter.setFilter(global.grid.filter.grid.filter.moduleClass.or("test"));

Earlier I asked for a sample expression. I went and tried the code above and seems to refresh the grid but comes back as No items to display. I do have data that match test and if I do a manual filter I see data returning. What am I missing here.

At https://github.com/oria/gridx/wiki/How-to-filter-Gridx-with-any-condition%3F ( see Filter Expressions)

I was able to accomplish the task using the following code in the diji.tree onClick event.

                 global.grid.filterBar.applyFilter({
                    conditions: [{
                        condition: 'contain',
                        value: 'test'
                    }]
                });

This is a comment rather than an answer, but I can't post comments yet.

Can you post a working snippet of code? That's not complete, as I don't see your store that you're specifying, etc.

I usually do a myinstancename.grid.body.refresh(); to accomplish a proper refresh.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM