extJs user
extJs user

Reputation: 1

How to expand Rowwidget by default

As a last ditch effort, I am asking here.

I made a grid similar to the one in kitchen sink https://examples.sencha.com/extjs/6.6.0/examples/kitchensink/#row-widget-grid

However, no matter what I try I am not able to get the grid expanded by default.

How to achieve this ?

I tried overriding the row-expander code and expanding each row individually. Though it works, it takes a lot of time. Around 15 mins for 100 - 200 rows

Upvotes: 0

Views: 1103

Answers (1)

Victor Barzana
Victor Barzana

Reputation: 11

I would wait for the grid to load the data, the view has to be ready as well, once you get there, you can try out the following piece of code, maybe inside your ViewController:

var grid = this.getView();
var view = grid.getView();
var rowWidget = grid.getPlugin('rowwidget');
if (!grid.rendered || !rowWidget) {
    return;
}
var data = grid.getStore().getRange();
// if for some reason this doesn't work, try waiting until the grid is completely rendered (when you see it)
data.forEach(function(record){
    rowWidget.toggleRow(view.getRow(record), record);
});

Upvotes: 0

Related Questions