Creating a Customized Pop-up Box with Bootstrap CSS and JQuery/Java Integration

I have a filter box that appears when the filter icon is clicked, but it currently lacks Bootstrap styling. I am in the process of upgrading the website to Bootstrap3 HTML5.

The current appearance of the filter icon is as follows:

However, we want it to be styled like this:

Below is my code with the old styling, but I am not very skilled at styling using jQuery/Java

document.getElementById('<%:cell.ColumnIdentifier%>_link').addEvent('click', function()
    {
        if(filterPopUp == null){}
        else
        {
            filterPopUp.hide();
        }
        filterPopUp = new StickyWin.PointyTip("Add filter for <%:cell.Value %>", "<%= String.Format("Values from <input id='{0}_from' name='{0}_from' value='{1}'/> &nbsp;to <input id='{0}_to' name='{0}_to' value='{2}'/><br/><div style='text-align:right !important;margin-right:0px;margin-top:5px;'><input type='button' onclick='SubmitForm(this, \\\"filter\\\");' id='{0}' name='{0}' value='Apply' style='margin-right:10px;background-color:#CCCCCC;text-align:center !important;' class='greyButton89'/><input type='button' onclick='SubmitForm(this, \\\"clear\\\");' id='{0}' name='{0}' value='Clear' class='greyButton89' style='background-color:#CCCCCC;text-align:center !important;'/></div>", cell.ColumnIdentifier, defaultMin, defaultMax)%>", {
        point: 'up',
        pointyOptions: { theme: 'light' },
        relativeTo: '<%:cell.ColumnIdentifier%>_img'
        });
        
        return false;
    });

This is the code I used for the mockup:

<div class='col-sm-4 hidden-xs'>
        <div class='panel panel-default'>
            <div class='panel-heading'>
                <h3 class='panel-title'>Add filter for Test</h3>
            </div>
            <div class='panel-body'>
                <div class='form-group'>
                    <label class='col-sm-5 control-label'>Amount from</label>
                    <div class='col-sm-7'>
                        <div class="input-group">
                            <span class="input-group-addon">£</span>
                            <input type="text" class="form-control">
                        </div>
                </div>
                </div>
                <div class='form-group'>
                    <label class='col-sm-5 control-label'>Amount to</label>
                    <div class="col-sm-7">
                        <div class="input-group">
                            <span class="input-group-addon">£</span>
                            <input type="text" class="form-control">
                        </div>
                    </div>
                </div>
                <div class='form-group pull-right'>
                    <div class='col-sm-12'>
                        <button type='button' class='btn btn-default'>
                            <span class='glyphicon glyphicon-ok'></span> Apply
                        </button>
                        <button type='button' class='btn btn-default'>
                            <span class='glyphicon glyphicon-remove'></span> Clear
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>

Firstly, can this be achieved?

If so, how?

Thank you,

Antony

Answer №1

To enhance the functionality, consider relocating certain code to the page element where the popup is connected. Could you kindly share the relevant HTML snippet where this popup is linked?

document.getElementById('<%:cell.ColumnIdentifier%>_link').addEvent('click', function()
    {
        if(filterPopUp == null){}
        else
        {
            filterPopUp.hide();
        }
        // Additional code for creating and displaying a pop-up window goes here...
        
        return false;
    });

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Style the date using moment

All languages had a question like this except for JavaScript. I am trying to determine, based on the variable "day," whether it represents today, tomorrow, or any other day. ...

Struggling to navigate the world of JavaScript and find the sum of odd numbers?

Currently facing a roadblock with a codewars exercise and in need of some assistance. The exercise involves finding the row sums of a triangle consisting of consecutive odd numbers: 1 3 5 7 9 11 13 15 17 ...

How should we arrange these components to optimize the overall aesthetic of this particular design?

My current progress on the code: Visit this link Desired design for reference: View design picture here I've experimented with position relative and margins, but these techniques have impacted the responsiveness of my webpage. What is the most eff ...

Issue with Material-UI Dialog Reusable Component: No error messages in console and app remains stable

Here is a component I've created for reusability: import { Dialog, DialogContent, DialogContentText, DialogTitle, Divider, Button, DialogActions, } from "@mui/material"; const Modal = ({ title, subtitle, children, isOpen, hand ...

Eliminate any line breaks from the information retrieved from the node event process.stdin.on("data") function

I've been struggling to find a solution to this issue. No matter what approach I take, I can't seem to remove the new line character at the end of my string. Take a look at my code below. I attempted using str.replace() in an effort to eliminate ...

Is there a way to save a Morris.js chart as a PDF file

I have successfully created a Morris.js Bar Chart using data from PHP and MySQL. Now, I am looking for a way to export this chart into a PDF format. I have attempted to do so using the FPDF library but I am struggling with the implementation. Can anyone ...

Eliminating fillers dashes from a text

Imagine having a string filled with soft hyphens like the one below: T-h-i-s- -i-s- -a- -t-e-s-t-.- The goal is to eliminate these soft hyphens and get back the clean string: This is a test. Attempting this task in JavaScript, here's how far I&apo ...

Arranging two divs to appear side by side, but they are mysteriously aligning in a diagonal pattern

I'm facing an issue with my navbar's divs not displaying side by side when set to display inline. Here is the HTML code snippet: <!--Nav starts here--> <nav class="navbar"> <div class="navbar-item-set"> ...

I'm encountering a Type Error message in VS Code terminal stating that converting data to string is not a function. Can someone please help me understand this type error? I am new to Node.js and

const fileSystem = require('fs'); const data = fileSystem.readFileSync('example.txt'); if (data) console.log(data.toString()); console.log('Program Ended'); This is the code I wrote: and this is the error message my terminal ...

Navigating through a list using tabs and automatic scrolling to a specific index in React with Material UI's Scrollspy

If there was a vast array of items, each belonging to a specific category, const categories: string[] = [0, 1, 2, 3, 4, 5]; const items: {name: string, category: number}[] = [{name: "foo", category: 1}, {name: "bar", category: 1}, {name ...

Why does the implementation of my interface differ from what is specified in the TypeScript documentation?

Currently delving into the world of TypeScript documentation https://www.typescriptlang.org/docs/handbook/2/classes.html Specifically focusing on the section implements Clauses, an interesting revelation surfaces: A Word of Caution It’s worth noting t ...

Exploring the Potential of Using ngIf-else Expressions in Angular 2

Here is a code snippet that I wrote: <tr *ngFor="let sample of data; let i = index" [attr.data-index]="i"> <ng-container *ngIf="sample.configuration_type == 1; then thenBlock; else elseBlock"></ng-container> <ng-template #t ...

Leveraging React's useEffect hook to asynchronously fetch and load data

In my coding scenario, there is a parent component containing a child component which loads data asynchronously. This is what I currently have: <Parent> <AsyncChild data={props.data} /> <Child /> </Parent> Within the AsyncChil ...

Using jQuery to redirect in Spring MVC

When I make an AJAX call to a controller, I want it to redirect to a new page upon success. I've placed the redirection logic within my success callback function, but instead of redirecting, it stays on the current page. What's particularly inte ...

The dependability of the onbeforeunload function

Is the event window.onbeforeunload considered reliable? Does it trigger in all popular browsers? Will it still trigger if the client browser crashes? Can it effectively postpone the close event if more time is needed, or does it get interrupted? Are the ...

Exploring the world of JSON and JSONP with JQuery

I'm experiencing some issues with my $.getJSON method, whereas the $.ajax method works perfectly fine. Let's first take a look at my getJSON call: $.getJSON("http://localhost:1505/getServiceImageList?callback=loadImagesInSelect", loadImagesInSel ...

Proper functionality of Chrome Extension chrome.downloads.download

I am currently developing an extension with a feature that allows users to download a file. This file is generated using data retrieved from the localStorage in Chrome. Within my panel.html file, the code looks like this: <!DOCTYPE html> <html&g ...

Loopback Model Property Somehow Resurrected After Deletion

Within my function, I am working with an object called 'ctx.instance' that contains various properties: firstName: 'Ron', lastName: 'Santo', minor: true, accepted: false, emailChanged: false, organizationId: 00000000000000000 ...

How can I duplicate or extract all the formatting applied to a specific text selection in Ckeditor?

I am currently utilizing CKEditor version 3.6 within my Asp.net MVC 3 Application. One of my tasks involves creating a Paint format option similar to Google Docs. I am looking to integrate this feature into CKEditor. Is there a way in CKEditor to transfe ...

"Utilizing AngularJS event system through $broadcast and $on

I have recently started learning AngularJS and I am trying to send a message from one controller to another. I have looked at various examples and my code seems to be similar, but it is not working. Why is $rootScope.$on not working? Can anyone help me wit ...