SlickUpload
Welcome Guest Search | Active Topics | Log In | Register

using slickupload in a display:none div Options
jgreen
#1 Posted : Monday, June 22, 2009 4:25:39 PM
Rank: Newbie

Groups: Registered

Joined: 3/23/2007
Posts: 9

I have a mvc app with a div defined like this:

<div id="ShowModify" style="display: none; background-color: silver; position: absolute; width: 300px; height: 300px"><kw:SlickUpload ID="SlickUpload1" runat="server" UploadFormId="uploadForm" ShowDuringUploadElements="cancelButton"
                                            HideDuringUploadElements="uploadButton">
                                            <DownlevelSelectorTemplate>
                                                <input type="file" />
                                            </DownlevelSelectorTemplate>
                                            <uplevelselectortemplate>
                                                <input type="button" value="Add File" class="addFile" />
                                            </uplevelselectortemplate>
                                            <FileTemplate>
                                                <div class="first_row">
                                                    <div class="lert_row">
                                                        <kw:FileListValidationMessage ID="FileListValidationMessage1" runat="server" ForeColor="Red" />
                                                        <label>
                                                            <kw:FileListFileName ID="FileListFileName1" runat="server" />
                                                        </label>
                                                        <input name="title" type="text" class="txtfield" value="Photo Name: Max 30 Characters"
                                                            onfocus="if(this.value=='Photo Name: Max 30 Characters')this.value='';" onblur="if(this.value=='')this.value='Photo Name: Max 30 Characters';" />
                                                        <kw:FileListRemoveLink ID="FileListRemoveLink1" runat="server">
                                                            <small>[x] remove</small></kw:FileListRemoveLink>
                                                    </div>
                                                    <div class="right_row">
                                                        <textarea name="caption" cols="" rows="">Photo Caption/Description:  Max 250 characters</textarea>
                                                    </div>
                                                </div>
                                            </FileTemplate>
                                            <ProgressTemplate>
                                                <table width="99%">
                                                    <tr>
                                                        <td>
                                                            Uploading
                                                            <kw:UploadProgressElement ID="UploadProgressElement1" runat="server" Element="FileCountText" />
                                                            ,
                                                            <kw:UploadProgressElement ID="UploadProgressElement2" runat="server" Element="ContentLengthText">
                                                                (calculating)</kw:UploadProgressElement>
                                                            .
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            Currently uploading:
                                                            <kw:UploadProgressElement ID="UploadProgressElement3" runat="server" Element="CurrentFileName" />
                                                            , file
                                                            <kw:UploadProgressElement ID="UploadProgressElement4" runat="server" Element="CurrentFileIndex">
                                                                &nbsp;</kw:UploadProgressElement>
                                                            of
                                                            <kw:UploadProgressElement ID="UploadProgressElement5" runat="server" Element="FileCount" />
                                                            .
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            Speed:
                                                            <kw:UploadProgressElement ID="UploadProgressElement6" runat="server" Element="SpeedText">
                                                                (calculating)</kw:UploadProgressElement>
                                                            .
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            About
                                                            <kw:UploadProgressElement ID="UploadProgressElement7" runat="server" Element="TimeRemainingText">
                                                                (calculating)</kw:UploadProgressElement>
                                                            remaining.
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <div style="border: 1px solid #008800; height: 1.5em; position: relative">
                                                                <kw:UploadProgressBarElement ID="UploadProgressBarElement1" runat="server" Style="background-color: #00ee00;
                                                                    width: 0; height: 1.5em" />
                                                                <div style="text-align: center; position: absolute; top: .15em; width: 100%">
                                                                    <kw:UploadProgressElement ID="UploadProgressElement8" runat="server" Element="PercentCompleteText">
                                                                        (calculating)</kw:UploadProgressElement>
                                                                </div>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </ProgressTemplate>
                                        </kw:SlickUpload>
                                        <p>
                                            <input type="submit" value="Upload" id="uploadButton" />
                                            <a href="javascript:kw.get('<%=SlickUpload1.ClientID %>').cancel()" id="cancelButton"
                                                style="display: none">Cancel</a>
                                        </p>
                                    </div>

 

I have a javascript function using jquery 1.3.2 and jquery-ui-1.7.2 to show the div:

function openMe(div) {
            var pos = $('#' + div).offset();
            var width = $('#' + div).width();
            var height = $('#' + div).outerHeight();
            $('#ShowModify').css({ "left": (pos.left - (2 * (width - 28))) + "px", "top": (pos.top + height) + "px" });
            $('#ShowModify').show('slide', { direction: 'right' }, 500);
        }

 

which shows the add file and and upload button as it should.  However after selecting a file to upload I don't see the file template.  If I click the upload button I do see the progress template.  Any idea on how I can get the file template to show up?

 

Thanks,

Josh

 

P.S. I am using the 5.2.7 build.

Axosoft
#2 Posted : Tuesday, June 23, 2009 11:37:40 AM
Rank: Administration


Groups: Administrators

Joined: 7/7/2005
Posts: 1,586
Location: Scottsdale, AZ

Sounds like the filelist elements are inheriting the parent styles and then keeping the display:none. We're looking into the issue and should have a fix out by COB today.

Axosoft
#3 Posted : Tuesday, June 23, 2009 4:50:44 PM
Rank: Administration


Groups: Administrators

Joined: 7/7/2005
Posts: 1,586
Location: Scottsdale, AZ

This appears to be an issue with positioning based on the uplevel file selector skinning. The problem is that the skin positioning code measures based on an element size and that isn't available when it's hidden.

To solve this, we've released a new version (5.2.8) that allows you to trigger the skin positioning manually after displaying the control. First install that version. Then call the SlickUpload.updateDisplay() method right after the control is made visible. Something like:

kw.get("<%=SlickUpload1.ClientID %>").updateDisplay();

Let me know how this works for you.

jgreen
#4 Posted : Thursday, June 25, 2009 11:46:05 AM
Rank: Newbie

Groups: Registered

Joined: 3/23/2007
Posts: 9
Thanks! That worked just fine.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.