PDA

View Full Version : Responsive extensions & bug fixes (Ext.NET Mobile 4.1.0)



unicorn64
Apr 06, 2017, 7:47 AM
Hi all,

I shared some extensions & bug fixes about responsive on mobile (using Ext.NET Mobile 4.1.0)
https://forums.ext.net/showthread.php?61840-CLOSED-1463-4-2-0-ResponsiveConfig-gives-js-error
https://forums.ext.net/showthread.php?61844-responsive-layout-change

and i will continue to share on this topic, if there is new ones ,

Container's default setting doesnt apply in responsive, if there is updateDefaults function which sets controls configs, it does



Ext.Container.override({
updateDefaults: function (defaults, oldDefaults) {
var me = this;
var items=[];
if (me.getInnerItems) {
items=me.getInnerItems();
}
else {
items = me.items.items;
}
Ext.each(items, function (item) {
if (item && item.setConfig)
item.setConfig(defaults);
});
},
});




@(
Html.X().Viewport().FitLayout()
.Items(
Html.X().Panel().BoxLayout()
.ResponsiveConfig(rules =>
{
var r = new ResponsiveRule();
r.Rule = "tall";
r.Config.Add(Html.X().Panel().Vertical().Title("tall").DefaultsObject(new { width = "100%" }));
rules.Add(r);

var r2 = new ResponsiveRule();
r2.Rule = "wide";
r2.Config.Add(Html.X().Panel().Horizontal().Title("wide").DefaultsObject(new { width = "50%" }));
rules.Add(r2);
})
.FixResponsivePlugin()
.Items(
Html.X().NumberField().Label("text1"),
Html.X().NumberField().Label("text2")
)

)
)


2489924900