Jump to content

Recommended Posts

Posted

Hi everybody,

I am currently developing a configurable module (no ProcessModule).

Some time ago I stumbled upon a forum post about using the VEX library in the backend. 

 

 Now, I wanted to try this in my module. But with the example code I get an almost useless dialog: 

<?php
//in init method
$this->modules->get('JqueryUI')->use('vex');
//javascript
ProcessWire.confirm('Are you sure you want to continue?', function() {
  //ok
},function() {
  // canceled
});

leads to following screen: 

vex-pw.thumb.PNG.cbb47384a7e5d36acb0da0b266690fe6.PNG

There are no erros in console. I am using ProcessWire 3.0.148.
Did I miss something or doing something wrong?
 

Posted

It should work exactly like you said. Did you maybe not define a success callback? Then it would fallback to a regular confirm (though your screenshot does not like like a regular confirm...). https://github.com/processwire/processwire/blob/51629cdd5f381d3881133baf83e1bd2d9306f867/wire/templates-admin/scripts/main.js#L471

Check if "vex" is defined in your devtools console. There you can also try to show a vex alert like this: ProcessWire.alert('test');

Maybe your module is just not loaded?

Posted

Ok, interesting. I had the same problem today. It's important that loading VEX happens in ready() not in init() of the module ? 

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...