JQuery simplemodal close on codebehind function - javascript

Here's the thing
I have this master page, and in one of its slave pages there's a couple of Excel report generators, which, when retrieving the data, they take quite an awefull time because of the ammount of the data.
Well, i'm using a simplemodal windows to show a little gif to keep the user entertained. The thing is, i want this modal to close once its done doing the work
I can close it with the ESC key, but i want it to close by itself once its done working. I already tried with this code
SimpleModal breaks ASP.Net Postbacks
but it didnt worked, maybe its cuz i'm creating an excel file from a gridview, and its writting the scripr to another buffer.
I'm thinking on having close button on the modal once the whole thing its finished, but i'd rather have it close by itself
Any idea on how i can accomplish this will be pretty much appreciated

While I can't provide much help with SimpleModal, maybe you shouldn't use a modal dialog to show a loading/progress icon. I would suggest taking a look at spin.js:
http://fgnass.github.com/spin.js/
This probably makes a little more sense for your use case, and is pretty easy to use.
Good luck!

Try appending to the .NET form, this fixes some issues with jQuery's dialog so it may help.
$("#sample").modal({
opacity:80,
overlayCss: {backgroundColor:"#fff"}
}).parent().appendTo("form");

On the "work is done", you can programatically close the dialog using:
$.modal.close();

Well, i didnt wanted to use a popup windows, but given that to create a Excel file from a gridview needs to write the html of the gridview on the buffer and execute it, it was never reaching the part where the javascript was to be written and executed, so, no other choise than send the dataSet over a Session variable into a popup windows which generate the excel file, so having somehting like a parallel work
I had a pretty ugly issue with IE8, my save dialog wasn't appearing, it worked on IE6 and IE7, as well with opera, firefox and chrome, but IE was giving a issue. Found there's a security option which that didnt allowed the save dialog to appear. For any one having a similar issue, its on Internet option -> Security -> Custom Level... -> Downloas -> Automatic Prompting for file downloads -> Need to be "Enabled"
Any way, thanks for tha help, hope this info also helps someone else!

Related

Change layout of google chrome alertbox

I want to change layout of google chrome alert box, My basic need to alert value like "Item added sucessfully" but in google chrome alert box it is good to see can it is posible google chrome alert box show like a model window in the center of screen with some effective design?
Changing built-in alert dialog box for chrome/IE/FF is not possible.
Workaround is to use jQuery alert dialog.
Same question has already been asked here and answered.
you can also see an example in jsFiddle
$("<div>Test message</div>").dialog();
you can use alert("Item added sucessfully");
i suggest you to work with fancybox http://fancybox.net/ i don't think alert can be designed.
sometimes alert can be annoying and can be disabled by the browser if popping more than once, i suggest to use something else like facnybox
Frankly it isnot possible to change the default alert box. It is set by the browser devlopers and cannot be changed on the client side. Rather try popupwindows using jquery
Popup jquery
or a custom div popup or use some jquery code after searching which ever suits you the best :)
I know the answer is two years old, but I just wanted to point out that there is a good reason why you can not style some elements including the alert. It's security issue. If the alert could be customized, then the user may be tricked into doing something that he is not expecting.
Personally I use Swal, it's great jQuery plugin and can be easily customized to any web design.
http://t4t5.github.io/sweetalert/

CKFinder popup onbeforeunload javascript

I'm currently working with CKFinder to upload images to a web app (and so on).
Now the problem is, there is no callback when the window closes:
With that I mean something like the javascript "onbeforeunload" event. The popup function only returns the api, and the api only contains the document and not the window.
I've looked through the docs and found a "selectActionFunction", but no sign of a "cancelActionFunction" or something similar.
http://docs.cksource.com/ckfinder_2.x_api/symbols/CKFinder.config.html
Thanks
Ok, in the end I didn't really find a solution within ckfinder, but since I was already working with jquery ui I just opened the ckFinder in a ui dialog box. Which gives me the ability to add a callback to the close button.
Maybe it is possible to add a cancel callback through the skins, but I chose the quick way of ui dialogs. (The only skinning I tend to do is in CSS, which is more then enough most of times)
Anyway, I hope this helps someone else too.

Controlling the ShareThis javascript window opens

I have just started using ShareThis Widget to help handle social media integration with one of our sites. While the functionality is great, I feel I lose a lot of the capabilities I have if I were to code each item by hand, such as the ability to control the size of the windows opened by clicking a 'share' functionality.
While their site shows basic functions you can add to the buttons (url, etc) I am looking to customize the feel such that when a button is clicked, I can control the size of that window or even possibly open in an existing colorbox snippet.
Has anybody had luck with this before? When I try to control via javascript function it just seems to get overwritten or ignored.
You'd need to unbind their events and handle them all yourself. It probably isn't a good idea, as your code will be at the mercy of their implementation.
I am not sure if your question is resolved, but you will need to add as following inside JS.
popup: 'true'
The same is on their Support Page

Multiple windows in one page for bookmarks

I want a single online web page for my bookmarks. The page should include small windows which opens the following pages:
Fizy, Facebook, Guardian.
There should also be a button for adding a new window with an URL text input.
Here's an illustration of how the page should look: http://i54.tinypic.com/2hrkb48.jpg
I've built a version of this at http://bit.ly/heqEd1, but as you may see, it uses iframes under javascript windows, which can not open frame-breaking sites (like fizy.com), or Facebook.
I'll make the research and but I am not sure how to proceed. Any solution will be accepted, like HTML5, XUL, Flex, AJAX or others. A solution with a local installation(like a Firefox extension) is not preferred, but still be ok.
Note: Piro Sakura has built a Firefox extension called split-browser. There's an element of the project called "subbrowser". An AJAX window that can show a subbrowser MAY solve the problem. I know the page will only be available from Firefox, but that is ok. (Again, a solution without an installation is preferred)
Any suggestions? How should I proceed? What should I learn? Is this possible?
Thanks.
I think you should use a Javascript with iFrames to do this. I'm not too sure what you're trying to accomplish with this, but it should be possible. As for which framework you'll use, it's up to you, but there will be a lot of custom code needed to implement this.
You can make multiple draggable windows in FLEX same as you have in you app
Please check sample as Starting point Movable/Draggable window and its demo
also u knows JS-DESKTOP lib with little customization to achieve that one of them are
jsdesk
sonspring-JQuery based
also you can do this using
Hopes that helps

mouseover not working in ie7

Having problems in IE7.It does not show me the "mouse over- drop down".
This "mouse over" was working well till yesterday also works in FireFox.
There a table that displays all the current documents.When one does a mouse over on a given document,it displays a list of options in form of a dropdown.
Can it be corrected in IE settings etc?
I am not talking about the javascript here , only the user settings.I am strictly the end user in this case.Also i tried downloading IE8 and it stopped in between.Hence I checked the ActiveX settings in IE and it was enabled.
Kindly help.
Your question seems well-founded, but it's difficult to discern what the question is exactly. Could you please elaborate? Source code may also help.
If you'd like to go a more DIY route, try throwing your code at JSLint. It will magically surface errors you didn't see.
Sitecore generates a lot of temporary and debug code files. This could be the problem. I would try deleting all of the temp/debug files, and see if that helps. They are scattered throughout the site, so you have to hunt for the debug directories.
However, I do see a lot of WEIRD JavaScript things with SiteCore. Sometimes I will load the content editor, and it wont work because of JS errors. I clear my cache and refresh and it works fine. But nothing in the JavaScript should be changing, since it would be the scripts from the vendor. I don't go in and change JS. Maybe they are generating JS somewhere.

Categories