0

I would like to use a button next to a selection list. That button would present a popup iframe with a datagrid of the records.

It all works when I include the 'jquery.mobile-1.4.5.min.js', but when I do, it changes the look and feel of the site completely to a mobile app. Is there a way or another library that I can use to avoid this behavior?

Here is what the popup looks like (but with a bad mobile look-and-feel): with jquery.mobile-1.4.5.min.js

Without the 'jquery.mobile-1.4.5.min.js' it looks like this: without jquery.mobile-1.4.5.min.js

Can anyone help me with this?

5
  • Is the question how to style the dialog or how to make it work? Commented Oct 28, 2015 at 14:53
  • Is this a mobile app? If not use jquery-ui instead of jquery.mobile. Commented Oct 28, 2015 at 14:54
  • Search for "jQuery Modal Plugins" and pick the one that best suits your needs. Commented Oct 28, 2015 at 14:56
  • It is the question on how to make it work without changing the style. I will look in to the query-ui library, thanks. If that doesn't work I will lookup the Modal plugins Commented Oct 28, 2015 at 15:21
  • I will try the light box when I find the time Commented Oct 31, 2015 at 9:26

2 Answers 2

1

You can create a simple light box using javascript and css. Then use ajax to load the datagrid of records into the lightbox.

CSS

.black_overlay{
display: none;
position: fixed;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: black;
z-index:1001;
-moz-opacity: 0.8;
opacity:.80;
filter: alpha(opacity=80);
}

.white_content {
display: none;
position: fixed;
top: 5%;
left: 5%;
width: 90%;
height: auto;
max-height: 90%;
padding: 16px;
border: 2px solid #930;
background-color: white;
z-index:1002;
overflow: auto;
}

Add this to your page HTML code

<div id="light" class="white_content"></div>
<div id="fade" class="black_overlay"></div>

The make an ajax call to get the records when the button is click. This snippet will work. Though you will have to modify it to suit your program

$(document).ready(function(e) {
$(document).delegate('#btnID', 'click', function(){
    $('.white_content').html(''); //set lightbox body to blank
    $.post(url,
    {
        //data
        },
        function(data, status){
            $('.white_content').html(data);
            }).fail(function(){
                $('.white_content').html('Loading failed')
                });
    });
});
Sign up to request clarification or add additional context in comments.

Comments

0

Solved by using the jQuery-ui libraries.

enter image description here

Will still have to look into the issue where the Bootstrap menu does not roll over the iFrame... For now I have put the iFrame completely over the menu. (will have sometihng to do with z-index I guess)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.