Jan 18, 2019, 7:15 AM
How to set renderer in code behind for RowExpander plugin?
I'm using ext.net 1.7 and extjs 3.4 for this project. Not upgraded yet because it will be a massive work to be done since it was developer years ago.
In my C# class, how can I set renderer as I want to hide the expander based on conditions?
C#
I have tried calling the plugin in Javascript and set the renderer once the the Parent Grid Panel is being initialized. But it doesn't hit the code at all.
Javascript
In my C# class, how can I set renderer as I want to hide the expander based on conditions?
C#
var re = new RowExpander
{
ID = "RulesRowExpander",
Width = 50,
Listeners =
{
Expand =
{
Handler = "#{" + ID + "}.rowExpanderOnExpandListener(record.id);"
},
BeforeExpand =
{
Handler = "#{" + ID + "}.rowExpanderBeforeExpandHandler(this);"
}
},
};
I have tried calling the plugin in Javascript and set the renderer once the the Parent Grid Panel is being initialized. But it doesn't hit the code at all.
Javascript
Ext.ux.RulesGridPanel = Ext.extend(Ext.ux.PagePartGridPanel,
{
constructor: function(config) {
Ext.ux.RulesGridPanel.superclass.constructor.call(this, config);
},
initComponent: function () {
Ext.ux.PagePartGridPanel.superclass.initComponent.apply(this, arguments);
this.buildFirstLevel();
var grid = this;
var components = grid.plugins;
var re = components.find(comp => comp.proxyId === 'RulesRowExpander');
re.renderer = function (v, p, record) {
p.id = '';
return '*';
};
}
}
Last edited by jenna; Jan 22, 2019 at 1:36 AM.