This is a migrated thread and some comments may be shown as answers.

[Solved] Dialog box not showing

6 Answers 743 Views
Upload
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Charley
Top achievements
Rank 1
Charley asked on 14 Sep 2011, 02:52 PM
I have inserted the upload button into a jquery modul window.  When you press the upload button nothing happens.  I need to have it in the modul.  Please advise on a possible fix.  Thanks for the reply.


Regards

Charley

6 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 14 Sep 2011, 03:16 PM
Hello Charley,

The problem may be related to z-index and stacking contexts, which cause the upload to be positioned under the modal window. Alternatively, the modal window may be cancelling some click events. However, I cannot provide further advice without a running demo or a live URL.

All the best,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Matt
Top achievements
Rank 1
answered on 14 Sep 2011, 04:20 PM
Dimo

Thanks for the quick response.  I am posting partial html as well as partial javascript.  I created a jquery extension that gets the highest z-index of all elements in the DOM.  I use this to set the z-index of the div that contains the upload button and its pieces. 
HTML of modul
    <div id="repairLineExtraFields">   <!-- + other form plain html fields -->
        <div style="float:right;width:200px;margin-left:8px;">
            <p>
                <div style="float:left;height:200px;" id="downLoadDialog">
                    @(
                        Html.Telerik().Upload()
                                   .Name("fileNames")
                            .Multiple(false)
                            .Async(async => async
                                .Save("UploadFile", "Invoices", new { messageId = "testID" })
                                .AutoUpload(false)
                            )
                            .ClientEvents(events => events
                                .OnError("onError")
                            )
                    )
                </div>
            </p>
        </div>
    </div>
 
 
Javascript
    $(document).ready(function () {
        $("#repairLineExtraFields").dialog({
            resizable: false,
            draggable: true,
            modal: true,
            width: 610,
            height: 350,
            autoOpen: false,
            open: function(){
                    $("#downLoadDialog").css('zIndex', ($(document.body).findHighestZindex() - -1));
                    $(".t-upload-button").click(function(){alert('hi uploader');});
                    getCurrentRepairLineExtraFieldInformation();
                },
            buttons: {
                "Update Repair Line": function () {
                    updateCurrentRepairLineExtraFieldInformation();
                    if(validRepairLineExtraFields)
                    {
                        $(this).dialog("close");
                    }
                },
                Cancel: function () {
                    clearExtraRepirLineFields();
                    $(this).dialog("close");
                }
            }
        });
        $('.btnadditional').click(function () {
            $("#repairLineExtraFields").dialog('open');
        });  // plus other stuff unrelated.
    });
    (function($){
        $.fn.findHighestZindex = function()
        
            var zIndexArray = [0];
            var all = document.getElementsByTagName("*");
            for (var i=0, max=all.length; i < max; i++)
            {
                var zIndex = all[i].style.zIndex;
                if(zIndex != '')
                {
                    zIndexArray.push(parseInt(zIndex));
                }
            }
            var largestZindex = Math.max.apply(Math, zIndexArray);
        return largestZindex;
        };
    })(jQuery);
0
Charley
Top achievements
Rank 1
answered on 14 Sep 2011, 08:25 PM
Dimo, I apologize for posting a response under my bosses account.  It was me who posted the code.  Thanks for the reply.
0
Dimo
Telerik team
answered on 15 Sep 2011, 06:36 AM
Hi Charley,

It turned out the issue is the same as the following:

http://www.telerik.com/community/forums/aspnet-mvc/upload/upload-control-in-modal-jquery-dialog.aspx

Regards,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Matt
Top achievements
Rank 1
answered on 11 Oct 2011, 06:04 PM
Dimo

This fix is broken in IE9.  Please advise on a solution.  Regards

0
Dimo
Telerik team
answered on 12 Oct 2011, 09:45 AM
Hi Matt,

I am not sure what do you mean by "broken fix". The z-index workaround works with the project attached in the forum thread above. Please compare with your implementation. Most probably you don't need to fiddle with the z-index styles with additional Javascript.

Regards,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
Upload
Asked by
Charley
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Matt
Top achievements
Rank 1
Charley
Top achievements
Rank 1
Share this question
or