Finding a way to revert JQuery UI dialog dialog's function - jquery-ui-dialog

I am trying to find a way to revert a jQuery UI dialog's dialog() call.
What I am doing in my app first is calling dialog on a div as such:
$('#dialog').dialog({
...options
});
Then once the user presses the close button, I would like the div tag and its content to reappear again at the same place it was before calling dialog() but not in the jQuery dialog.
I've tried this :
$('#dialog').dialog('close');
$('#dialog').show();
but it doesn't work. It seems that the #dialog's content is emptied when dialog('destroy') is called.
Any ideas?
Thanks,
Jimmy

Perhaps what you can do is to duplicate #dialog to an new div, and dialog() that one, leaving the original untouched.

In fact it was a bit more difficult than a straight html() or append() since in my div I had a jQuery datatables component + a bunch of other custom events. So I first had to deeply clone its children with all the events then call fadeIn() fadeOut() in the right place. So here I go:
The HTML (the #dialog children get cloned Inside the #dialog2 div):
<div id="main">
<div id='dialog'>
<input id='input1' type="text"></input>
<input id='input2' type="text"></input>
<table cellpadding="0" cellspacing="0" border="0" class="display" id="example" width="100%">
<thead>
<tr>
<th>Rendering engine</th>
<th>Browser</th>
<th>Platform(s)</th>
<th>Engine version</th>
<th>CSS grade</th>
</tr>
</thead>
<tbody>
<tr class="odd gradeX">
<td>Trident</td>
<td>Internet
Explorer 4.0</td>
<td>Win 95+</td>
<td class="center"> 4</td>
<td class="center">X</td>
</tr>
<tr class="even gradeC">
<td>Trident</td>
<td>Internet
Explorer 5.0</td>
<td>Win 95+</td>
<td class="center">5</td>
<td class="center">C</td>
</tr>
</tbody>
<tfoot>
<tr>
<th>Rendering engine</th>
<th>Browser</th>
<th>Platform(s)</th>
<th>Engine version</th>
<th>CSS grade</th>
</tr>
</tfoot>
</table>
</div>
<div id='dialog2' style='display:block;'>
</div>
<button id="open">Detach Me</button>
The JavaScript:
<script type="text/javascript">
$(document).ready(function(){
$("#dialog").children().clone(true, true).appendTo($("#dialog2"));
$('#dialog2').hide();
$('#open').click(function(){
$('#dialog2').fadeOut();
$("#dialog").dialog({
width: 1000,
height:800,
close : function(){
$('#dialog2').fadeIn();
return true;
}
});
});
this.datatable = $('table').dataTable({
"fnRowCallback": function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
$(nRow).on('click', function(){
$(this).addClass('selected', true);
});
}
});
});
</script>

Related

Vue.js Bootstrap Tooltip within v-for loop

i am trying to get the Bootstrap Tooltip to work within a vue v-for loop.
i am using vue 3 and bootstrap 5.20
my code:
<script>
....
$(document).ready(function(){
$('[data-bs-toggle="tooltip"]').tooltip();
});
export default {
.....
}
</script>
<template>
<div id="listForm" style="">
<table class="table table-striped table-bordered">
<thead >
<tr>
.....
</tr>
</thead>
<tbody>
<tr v-for="userEntry in userEntrys">
<td class="text-center">{{ userEntry.date }}</td>
<td class="text-center">{{ userEntry.place }}</td>
<td class="text-center">{{ userEntry.hours }}</td>
<td class="text-center"><a data-bs-toggle="tooltip" data-bs-placement="left" data-bs-container="body" :title="userEntry.hash">Log</a></td>
</tr>
</tbody>
</table>
</div>
</template>
i tried the tooltip outside of the v-for loop and it worked fine..
everytime i change something on the file and the vue live view in the browser updates, the tooltip within the loop works too.. but if i refresh the browser it never works again.
i hope someone can help me.
best regards Tom!

Real-Time Data-Binding

I have a table that displays a list of uploaded files. If I uploaded a file it needs to be reflected in the table. This is already happening — not, however, in real-time. I need to refresh the page to reflect the data that I need.
I tried refreshing the div in jquery but it is not working:
<div class="mjs-cell">
<div id="stipsData" data-bind="template:{name: 'rehash-customertab-stips-section', data: stipsViewModel}">
</div>
</div>
<div class="mjs-row">
<table class="table table-striped table-bordered">
<tr>
<th>Stip Name</th>
<th>Status</th>
<th>File Name</th>
</tr>
<tbody data-bind="foreach: $data">
<tr class="stips-row">
<td class="hidden stips-id" data-bind="text: StipulationTypeId"></td>
<td class="stips-text">
<a data-bind="text: StipulationType"></a>
</td>
<td class="stips-status">
<span data-bind="text: Status"></span>
</td>
<td class="stips-uploaded-file" data-bind="text: FileName"></td>
</tr>
</tbody>
</table>
</div>
Here is the code that I use for binding:
stipsViewModel = ko.computed(function () {
DealApiControllers.GetStipulations(dealId,
(response) => {
this.stipsViewModel = response.DealStipulationsDTOs;
},
(error) => {
console.error(error);
});
}, this);
For example the table shows Doc1, Doc2. If I upload Doc3 it should be reflected in the list.

Dynamic page rendering in meteor

Page rendering is not working with iron:router please help me.Rendering is not working with code.Please find the bellow attached code.And we are users meteor add iron:router 0.9.4.And we used meteor 0.9.3.1. Page rendering is not working
<head>
</head>
<body >
<div>
{{> players}}
</div>
</body>
<template name ="editform">
<div class="container">
<div class="row" style="border-bottom: 5px solid gray;">
<h2>Profile</h2>
</div>
<div id="wrapper">
<table>
<tr>
<td>First name:</td>
<td><input type="text" name="pff_name"/></td>
</tr>
<tr>
<td>Last name:</td>
<td><input type="text" name="pfl_name"/></td>
</tr>
<tr>
<td>Email Address:</td>
<td><input type="email" name="pfemail"/></td>
</tr>
<tr>
<td>Phone number:</td>
<td><input type="text" name="pfname"/></td>
</tr>
<tr>
<td>Company or Organization:</td>
<td><input type="url" name="pfname"/></td>
</tr>
</table>
</div>
</div>
</template>
<template name="players">
<div>
<table class="table table-condensed table-striped table-bordered table-hover no-margin">
<tr>
<th>IP</th>
<th></th>
</tr>
{{#each scorers}}
<tr>
<td><a href="{{ pathFor 'editform' }}" >{{ ip }}</a></td>
<td></td>
</tr>
{{/each}}
</table>
</div>
</template>
This router.js
Router.route("/", function() {
this.render("route");
});
It is unclear what you are trying to achieve.
May I suggest you to start by reading the Meteor Docs for starters.
For a simple app like this one you can use a structure like this:
/client (client side code files)
/server (server side code files)
collections.js
Check out a good way of structuring your app here.
First, you don't need the <head> and <body> tags here.
Then, you can create a layout template in client folder in which you can set the players template to render, also to add header, footer, etc to your page.
layout.html
<template name="layout">
{{>players}}
</template>
Then you need a players template in client folder as well.
I'm gonna go ahead and produce an simple example here to get you going. The user input value is collected, inserted into Players collection and for each player in that collection a new table row is created in div.result using a {{players}} helper.
players.html
<template name="players">
<div class="container">
<div class="row" style="border-bottom: 5px solid gray;">
<h2>Profile</h2>
</div>
<div id="wrapper">
<table>
<tr>
<td>First name:</td>
<td><input type="text" id="pff_name" /></td>
</tr>
<tr>
<td>Last name:</td>
<td><input type="text" id="pfl_name" /></td>
</tr>
</table>
<button class="insert">Submit</button>
</div><br/>
<div id="result">
<table class="table table-condensed table-striped table-bordered table-hover no-margin">
<tr>
<th>First Name</th>
<th>Last Name</th>
</tr>
{{#each players}}
<tr>
<td>{{firstname}}</td>
<td>{{lastname}}</td>
</tr>
{{/each}}
</table>
</div>
</div>
</template>
collections.js
Create a new Meteor Collection called Players, which will store all the added documents.
Players = new Meteor.Collection("players");
players.js
Here, the players helper will return a cursor and a created Meteor method named addPlayer is called.
Template.players.helpers({
players: function() {
return Players.find();
}
});
Template.players.events({
'click .insert': function(event, template) {
var first = $('#pff_name').val();
var last = $('#pfl_name').val();
if(first !== "" && last !== "") {
Meteor.call("addPlayer", first, last);
}
$('#pff_name').val("");
$('#pfl_name').val("");
}
});
server.js
Adding the player to Players collection
Meteor.startup(function () {
Meteor.methods({
addPlayer: function(fname, lname) {
Players.insert({firstname: fname, lastname: lname});
}
})
});
routrer.js
Tell Iron Router to render the players template
Router.map(function () {
this.route('players', {
path: '/',
template: 'players',
layoutTemplate: 'layout'
})
});
EDIT:
You are using IronRouter version 0.9.4, but your route is defined for the new version.
Either update IronRouter to iron:router#1.0.0-pre3 or follow the notation I gave for this version.
Sorry to be blunt, but you really need to read this.
At the very, very top it says:
Router.route('/', function () {
this.render('Home');
});
When the user navigates to the url "/", the route above will render the template named "Home" onto the page.
You have the line this.render("route"); in your router, but no template named "route".

Hiding table data using <div style="display:none">

So, I've hidden whole tables like this, which works fine:
<div style="display:none">
<table>
<tr><th>Test Table</th><tr>
<tr><td>123456789</td><tr>
<tr><td>123456789</td><tr>
<tr><td>123456789</td><tr>
</table>
</div>
But I want to hide just a group of rows like this:
<table>
<tr><th>Test Table</th><tr>
<div style="display:none">
<tr><td>123456789</td><tr>
<tr><td>123456789</td><tr>
<tr><td>123456789</td><tr>
</div>
</table>
But that doesn't work. Any hints?
Just apply the style attribute to the tr tag. In the case of multiple tr tags, you will have to apply the style to each element, or wrap them in a tbody tag:
<table>
<tr><th>Test Table</th><tr>
<tbody style="display:none">
<tr><td>123456789</td><tr>
<tr><td>123456789</td><tr>
<tr><td>123456789</td><tr>
</tbody>
</table>
Unfortuantely, as div elements can't be direct descendants of table elements, the way I know to do this is to apply the CSS rules you want to each tr element that you want to apply it to.
<table>
<tr><th>Test Table</th><tr>
<tr><td>123456789</td><tr>
<tr style="display: none; other-property: value;"><td>123456789</td><tr>
<tr style="display: none; other-property: value;"><td>123456789</td><tr>
<tr><td>123456789</td><tr>
<tr><td>123456789</td><tr>
</table>
If you have more than one CSS rule to apply to the rows in question, give the applicable rows a class instead and offload the rules to external CSS.
<table>
<tr><th>Test Table</th><tr>
<tr><td>123456789</td><tr>
<tr class="something"><td>123456789</td><tr>
<tr class="something"><td>123456789</td><tr>
<tr><td>123456789</td><tr>
<tr><td>123456789</td><tr>
</table>
Just set the display:none on the elements that you want to hide:
<table>
<tr><th>Test Table</th><tr>
<tr style="display:none"><td>1. 123456789</td><tr>
<tr><td>2. 123456789</td><tr>
<tr><td>3. 123456789</td><tr>
</table>
<style type="text/css">
.hidden { display:none; }
</style>
<table>
<tr><th>Test Table</th><tr>
<tr class="hidden"><td>123456789</td></tr>
<tr class="hidden"><td>123456789</td></tr>
<tr class="hidden"><td>123456789</td></tr>
</table>
And instead of:
<div style="display:none;">
<table>...</table>
</div>
you had better use:
...
Give all the rows you want to hide a class name that you can use for hiding. Use javascript to add/remove this class from the different rows.
<table>
<tr><th>Test Table</th><tr>
<tr class="toHide"><td>123456789</td><tr>
<tr class="toHide"><td>123456789</td><tr>
<tr class="toHide"><td>123456789</td><tr>
</table>
CSS:
.toHide
{
display: none;
}
You are not allowed to have div tags between tr tags. You have to look for some other strategies like creating a CSS class with display: none and adding it to concerning rows or adding inline style display: none to concerning rows.
.hidden
{
display:none;
}
<table>
<tr><td>I am visible</td><tr>
<tr class="hidden"><td>I am hidden using CSS class</td><tr>
<tr class="hidden"><td>I am hidden using CSS class</td><tr>
<tr class="hidden"><td>I am hidden using CSS class</td><tr>
<tr class="hidden"><td>I am hidden using CSS class</td><tr>
</table>
or
<table>
<tr><td>I am visible</td><tr>
<tr style="display:none"><td>I am hidden using inline style</td><tr>
<tr style="display:none"><td>I am hidden using inline style</td><tr>
<tr style="display:none"><td>I am hidden using inline style</td><tr>
</table>
Wrap the sections you want to hide in their own tbody and dynamically show/hide that.
Yes, you can hide only the rows that you want to hide. This can be helpful if you want to show rows only when some condition is satisfied in the rows that are currently being shown. The following worked for me.
<table>
<tr><th>Sample Table</th></tr>
<tr id="row1">
<td><input id="data1" type="text" name="data1" /></td>
</tr>
<tr id="row2" style="display: none;">
<td><input id="data2" type="text" name="data2" /></td>
</tr>
<tr id="row3" style="display: none;">
<td><input id="data3" type="text" name="data3" /></td>
</tr>
</table>
In CSS, do the following:
#row2{
display: none;
}
#row3{
display: none;
}
In JQuery, you might have something like the following to show the desired rows.
$(document).ready(function(){
if($("#row1").val() === "sometext"){ //your desired condition
$("#row2").show();
}
if($("#row2").val() !== ""){ //your desired condition
$("#row3").show();
}
});
Instead of using <div>, it would be better to use to provide the <tr> (which you want to hide) an id and then hiding it using javascript.
/* add javascript*/
{
document.getElementById('abc 1').style.display='none';
}
/* after that add html*/
<html>
<head>
<title>...</title>
</head>
<body>
<table border = 2>
<tr id = "abc 1">
<td>abcd</td>
</tr>
<tr id ="abc 2">
<td>efgh</td>
</tr>
</table>
</body>
</html>
you should add style="display:none" in any of <tr> that you want to hide.

Problem with HTML? Scrollbars Not Appearing via window.open

I have a VB.NET web application where I am opening a window when a user clicks on a link to view some external tabular data. The data I'm displaying definitely requires a vertical scrollbar in order to see everything...For some reason I cannot get a vertical scrollbar to show up when the new window loads.
Here's the JS that opens the window:
function showDataTable(id, type) {
var pageUrl = "queries/ReportData.aspx";
windowHandle = window.open(pageUrl, "FarmQuery", 'resizable=yes,scrollbars=yes');
windowHandle.focus();
}
The corresponding Page_Load method for the window being opened:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim db As New UtilDb
Dim errMsg As String = ""
If (Not Page.IsPostBack) Then
db.OpenGeoDb(MyGlobals.GeodataServiceName, errMsg)
LoadFarmInfo(db, errMsg)
LoadQueryData(db, errMsg)
db.CloseGeoDb()
End If
End Sub
And for what it's worth I added
style="overflow: scroll;"
To the div containing the data table.
It almost seems like the data table is rendering after the rest of the "page" has been contructed. Any suggestions?
EDIT
The problem occurs in Firefox and IE. I modified the window parameters argument in the JS from 'resizable=yes,scrollbars=yes' to 'resizable=yes,scrollbars=yes,toolbar=yes' and did get the toolbar to show up which indicates those options are "working".
Unfortunately I cannot post the HTML.
EDIT
Here's the sample HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>
Farm Query
</title><link href="../Default.css" type="text/css" rel="stylesheet" /><link href="ReportData.css" type="text/css" rel="stylesheet" /></head>
<body>
<form name="form1" method="post" action="ReportData.aspx?wfpId=DES-046&type=1" id="form1">
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="#" />
</div>
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>
<div>
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAwKP2r/ZCgLbzub6CgKJ+/qJC4VfHXBxZJkelz+i1sSmIFdWB5tZ" />
</div>
<div style="overflow: auto;">
<table class="dxgvControl" cellspacing="0" cellpadding="0" id="FarmerInfoGridView" border="0" style="width:600px;border-collapse:collapse;border-collapse:separate;">
<tr>
<td><table id="FarmerInfoGridView_DXMainTable" class="dxgvTable" cellspacing="0" cellpadding="0" border="0" style="width:100%;border-collapse:collapse;empty-cells:show;">
<tr id="FarmerInfoGridView_DXDataRow0" class="dxgvDataRow">
<td id="FarmerInfoGridView_tcrow0" colspan="7" style="border-right-width:0px;border-bottom-width:0px;">
<table width="100%" cellpadding="5" cellspacing="5">
<tr>
<td class="keyDescription">WFP ID:</td>
<td>asdf</td>
</tr>
<tr>
<td class="keyDescription">Name:</td>
<td>Name, Name</td>
</tr>
<tr>
<td class="keyDescription">Company Name:</td>
<td>Acme</td>
</tr>
<tr>
<td class="keyDescription">Address:</td>
<td>123 Lotus Lane</td>
</tr>
<tr>
<td class="keyDescription">City/State:</td>
<td>NY, NY</td>
</tr>
<tr>
<td class="keyDescription">Zip:</td>
<td>11111</td>
</tr>
</table>
</td>
</tr>
</table><img id="FarmerInfoGridView_IADD" src="#" alt="|" style="border-width:0px;position:absolute;visibility:hidden;" /><img id="FarmerInfoGridView_IADU" src="/SAM_Project/WebResource.axd" alt="|" style="border-width:0px;position:absolute;visibility:hidden;" /><img id="FarmerInfoGridView_IDHF" src="/SAM_Project/WebResource.axd" alt="Hide" style="border-width:0px;position:absolute;visibility:hidden;" /><div id="FarmerInfoGridView_LP" align="center" style="left:0px;top:0px;z-index:30000;display:none;">
<table class="dxgvLoadingPanel" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;">
<tr>
<td class="dx"><img src="/SAM_Project/WebResource.axd" alt="" align="middle" style="border-width:0px;" /></td><td class="dx" style="padding-left:0px;">Loading…</td>
</tr>
</table>
</div><div id="FarmerInfoGridView_LD" class="dxgvLoadingDiv" style="display:none;z-index:29999;position:absolute;">
</div><input type="hidden" name="FarmerInfoGridView$DXSelInput" id="FarmerInfoGridView_DXSelInput" /><table id="FarmerInfoGridView_DXStyleTable" border="0" style="display:none;">
<tr>
<td></td>
</tr><tr class="dxgvEditingErrorRow">
<td class="dxgv" colspan="7" style="border-right-width:0px;"></td>
</tr><tr class="dxgvSelectedRow">
<td></td>
</tr><tr class="dxgvFocusedRow">
<td></td>
</tr><tr class="dxgvFocusedGroupRow">
<td></td>
</tr><tr class="dxgvDataRow">
<td></td>
</tr>
</table><input type="hidden" name="FarmerInfoGridView$CallbackState" id="FarmerInfoGridView_CallbackState" value="#" /></td>
</tr>
</table><script id="dxss_27477558" type="text/javascript">
<!--
var dxo = new ASPxClientGridView('FarmerInfoGridView');
window['FarmerInfoGridView'] = dxo;
dxo.callBack = function(arg) { WebForm_DoCallback('FarmerInfoGridView',arg,aspxCallback,'FarmerInfoGridView',aspxCallbackError,true); };
dxo.callBacksEnabled=true;
dxo.pageRowCount=1;
dxo.pageRowSize=10;
dxo.selectedWithoutPageRowCount=0;
dxo.visibleStartIndex=0;
dxo.focusedRowIndex=-1;
dxo.allowFocusedRow=false;
dxo.allowMultiSelection=false;
dxo.isColumnsResizable=false;
dxo.isVerticalScrolling=false;
dxo.isHorizontalScrolling=false;
dxo.isMainControlResizable=false;
dxo.callbackOnFocusedRowChanged=false;
dxo.callbackOnSelectionChanged=false;
dxo.autoFilterDelay='1200';
dxo.ClearColumns();
dxo.CreateColumn('',0,'WFP_ID',1);
dxo.CreateColumn('',1,'Last_Name',1);
dxo.CreateColumn('',2,'First_name',1);
dxo.CreateColumn('',3,'Farm_Name',1);
dxo.CreateColumn('',4,'Address',1);
dxo.CreateColumn('',5,'City_State',1);
dxo.CreateColumn('',6,'Zip',1);
dxo.InlineInitialize();
//-->
</script>
<table class="dxgvControl" cellspacing="0" cellpadding="0" id="AnimalGridView" border="0" style="width:600px;border-collapse:collapse;border-collapse:separate;">
<tr>
<td><table id="AnimalGridView_DXMainTable" class="dxgvTable" cellspacing="0" cellpadding="0" border="0" style="width:100%;border-collapse:collapse;empty-cells:show;">
<tr id="AnimalGridView_DXDataRow0" class="dxgvDataRow">
<td id="AnimalGridView_tcrow0" colspan="43" style="border-right-width:0px;border-bottom-width:0px;">
<table cellpadding="5" cellspacing="5" width="100%" id="rounded-corner">
<tr>
<th colspan="8" class="tableHeader">Animal Inventory</th>
</tr>
<tr>
<td colspan="2">Updated:</td>
<td colspan="2">11/14/2007</td>
<td colspan="2">Total AU:</td>
<td colspan="2">0</td>
</tr>
<tr>
<td>Mature Dairy</td>
<td>0</td>
<td>Dairy Heifers</td>
<td>0</td>
<td>Veal</td>
<td>0</td>
<td>Beef</td>
<td>0</td>
</tr>
<tr>
<td>Calves</td>
<td>0</td>
<td>Bulls</td>
<td>0</td>
<td>Ducks</td>
<td>0</td>
<td>Elk</td>
<td>0</td>
</tr>
<tr>
<td>Sheep</td>
<td>0</td>
<td>Lambs</td>
<td>0</td>
<td>Geese</td>
<td>0</td>
<td>Buffalo</td>
<td>0</td>
</tr>
<tr>
<td>Goats</td>
<td>2</td>
<td>Kids</td>
<td>0</td>
<td>Rabbits</td>
<td>0</td>
<td>Bears</td>
<td>0</td>
</tr>
<tr>
<td>Pigs</td>
<td>0</td>
<td>Piglets</td>
<td>0</td>
<td>Emu</td>
<td>0</td>
<td>Mountain Lion</td>
<td>0</td>
</tr>
<tr>
<td>Horses</td>
<td>0</td>
<td>Foals</td>
<td>0</td>
<td>Ostrich</td>
<td>0</td>
<td>Guinea Pigs</td>
<td>0</td>
</tr>
<tr>
<td>Donkeys</td>
<td>0</td>
<td>Oxen</td>
<td>0</td>
<td>Walaroo</td>
<td>0</td>
<td>Greenhouse</td>
<td>0</td>
</tr>
<tr>
<td>Chickens</td>
<td>0</td>
<td>Turkeys</td>
<td>0</td>
<td>Llama</td>
<td>0</td>
<td>Vegetables</td>
<td>0</td>
</tr>
<tr>
<td>Ginny Hens</td>
<td>0</td>
<td>Peacock</td>
<td>0</td>
<td>Alpaca</td>
<td>0</td>
<td>Pheasant</td>
<td>0</td>
</tr>
<tr>
<td>Deer</td>
<td>0</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</td>
</tr>
</table><img id="AnimalGridView_IADD" src="/SAM_Project/WebResource.axd" alt="|" style="border-width:0px;position:absolute;visibility:hidden;" /><img id="AnimalGridView_IADU" src="/SAM_Project/WebResource.axd" alt="|" style="border-width:0px;position:absolute;visibility:hidden;" /><img id="AnimalGridView_IDHF" src="/SAM_Project/WebResource.axd" alt="Hide" style="border-width:0px;position:absolute;visibility:hidden;" /><div id="AnimalGridView_LP" align="center" style="left:0px;top:0px;z-index:30000;display:none;">
<table class="dxgvLoadingPanel" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;">
<tr>
<td class="dx"><img src="/SAM_Project/WebResource.axd" alt="" align="middle" style="border-width:0px;" /></td><td class="dx" style="padding-left:0px;">Loading…</td>
</tr>
</table>
</div><div id="AnimalGridView_LD" class="dxgvLoadingDiv" style="display:none;z-index:29999;position:absolute;">
</div><input type="hidden" name="AnimalGridView$DXSelInput" id="AnimalGridView_DXSelInput" /><table id="AnimalGridView_DXStyleTable" border="0" style="display:none;">
<tr>
<td></td>
</tr><tr class="dxgvEditingErrorRow">
<td class="dxgv" colspan="43" style="border-right-width:0px;"></td>
</tr><tr class="dxgvSelectedRow">
<td></td>
</tr><tr class="dxgvFocusedRow">
<td></td>
</tr><tr class="dxgvFocusedGroupRow">
<td></td>
</tr><tr class="dxgvDataRow">
<td></td>
</tr>
</table><input type="hidden" name="AnimalGridView$CallbackState" id="AnimalGridView_CallbackState" value="#" /></td>
</tr>
</table><script id="dxss_1369069069" type="text/javascript">
<!--
var dxo = new ASPxClientGridView('AnimalGridView');
window['AnimalGridView'] = dxo;
dxo.callBack = function(arg) { WebForm_DoCallback('AnimalGridView',arg,aspxCallback,'AnimalGridView',aspxCallbackError,true); };
dxo.callBacksEnabled=true;
dxo.pageRowCount=1;
dxo.pageRowSize=10;
dxo.selectedWithoutPageRowCount=0;
dxo.visibleStartIndex=0;
dxo.focusedRowIndex=-1;
dxo.allowFocusedRow=false;
dxo.allowMultiSelection=false;
dxo.isColumnsResizable=false;
dxo.isVerticalScrolling=false;
dxo.isHorizontalScrolling=false;
dxo.isMainControlResizable=false;
dxo.callbackOnFocusedRowChanged=false;
dxo.callbackOnSelectionChanged=false;
dxo.autoFilterDelay='1200';
dxo.ClearColumns();
//-->
</script>
<div style="margin-left: auto; margin-right: auto; width: 450px;padding: 5px 5px;"><input id="btnClose" type="submit" value="Close Window" onclick="window.close();" /></div>
</div>
<script type="text/javascript">
//<![CDATA[
WebForm_InitCallback();//]]>
</script>
</form>
</body>
</html>
If you want to always force a scroll bar on a page, try adding the following CSS to the page:
html {
overflow-y:scroll;
}
This will cause the page to always have a vertical scrollbar no matter if it is needed or not.
You might also want to change your code to use:
windowHandle = window.open(pageUrl, "FarmQuery", 'resizable=1,scrollbars=1');
as 1=yes/true but yes does not necessarily equal 1/true (funny cross browser logic!).
This definitely sounds like a CSS issue to me.
Try stripping your link to the CSS file out of the popup page and then see if the problem still exists (I bet it won't).
Then, this becomes a new question: What CSS could cause the scrollbars to disappear on a page?
A rule of overflow: hidden; on the body is a very likely culprit.
Have you tried sizing your main browser window to approximately the size of your popup window and directly navigating to the page that you would display in your popup? Do the scrollbars appear when you load the page directly? The popup window is possibly a red herring.
Scrollbars should just appear when you open a new window if the content doesn't fit the client area. Try adding "width=600,height=600" in your options to reduce the window size right down...if no bars are appearing it is more likely a css problem.
Remove your "default.css" line. Do you still get the problem?
When I tried the html you provided, and I resize the window so the content don't fit, I get scrollbars on the div (which appears slightly smaller than the full window). I tried to remove the style="overflow: auto;" on the div tag, and the scrollbar was only applied on the full window. This seems to work, and when you say that the scrollbars dont apply, my first thought is that it is something defined in your CSS files that causes the problem. It might be in either ../Default.css or ReportData.css .
If the style for div is set to overflow:hidden in one of the css files, you can override this to set style="overflow: visible;" in the div tag on your page. This will cause the content of the div not to be clipped, and scrolling is handled by the window instead of the div tag.
If it is not the div tag that is the problem, it might be some other tags. Look for overflow: hidden on any tags in your css files to see if that might be the problem.
There could be a Position:fixed in your css file which is preventing the scrollbars to appear.
window.open('CHFPhoneMonitoringChecklist.html', 'CHFwin', 'resizable=yes,location=1,status=1,scrollbars=1,width=1250,height=1000');

Resources