How to change options?

General issues related to the use of Metro 4
Post Reply
Autoflow
Posts: 7
Joined: Thu Jul 11, 2019 7:17 pm
Status: Offline

How to change options?

Post by Autoflow » Thu Jul 11, 2019 7:35 pm

I'm new to MetroUI CSS and i tried several things to change the caption of a window component programatically.
Without success.

Please could you leave a note how its possible to change ie. "clsCaption" of window component with Metro lib.

I create a default window instance:

Code: Select all

var win = Metro.window.create({clsCaption: 'ie. my-default-style'});
which i would like to update to an Alert-Window:

Code: Select all

win.data('window').win.attr('data-cls-caption', 'bg-red');
But it seems to me that the data observers are not working cause nothing changes.

Instead when i create a window by markup:

Code: Select all

<div class="window" data-role="window" data-cls-caption="bg-default">
and then change the caption by JS everything works fine.

Code: Select all

$('.window').attr('data-cls-caption', 'bg-red');
Many thanks!

User avatar
olton
Site Admin
Posts: 225
Joined: Mon Apr 09, 2018 6:19 pm
Location: Kiev, Ukraine
Status: Offline

Post by olton » Thu Jul 11, 2019 8:11 pm

This is a bug for runtime method Metro.window.create(...). Please create issue on GitHub (https://github.com/olton/Metro-UI-CSS). Thank you.

User avatar
olton
Site Admin
Posts: 225
Joined: Mon Apr 09, 2018 6:19 pm
Location: Kiev, Ukraine
Status: Offline

Post by olton » Fri Jul 12, 2019 11:30 am


Autoflow
Posts: 7
Joined: Thu Jul 11, 2019 7:17 pm
Status: Offline

Post by Autoflow » Sat Jul 13, 2019 4:13 pm

Hi Olton,
just wanted to post an issue ... :-)
Thank you very much for the fix.

Best regards,
Alexander

Post Reply