One js file nearly 500K !

Thread is closed for posting
10 posts, 1 answers
  1. hn
    hn avatar
    1 posts
    Member since:
    Mar 2007

    Posted 16 Jul 2012 Link to this post

    Is there anyway of splitting this file as we are only using a few controls and would like to reduce the size of our js files as much as possible.
    Many thanks
  2. Vesselin Obreshkov
    Vesselin Obreshkov avatar
    81 posts
    Member since:
    Jan 2010

    Posted 20 Jul 2012 Link to this post

    If you have a license you can use the custom download builder tool that you can include only the features you want/need. Otherwise, you can look at their documentation for the requirements for each control/feature you want to use.

    http://www.kendoui.com/documentation/javascript-dependencies.aspx 
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. hn
    hn avatar
    1 posts
    Member since:
    Mar 2007

    Posted 21 Jul 2012 Link to this post

    Many thanks.
    You are right, it was a case of "READ DOCUMENTATION" !
    You wouldn't know the answer to my questions on the Upload by any chance ?
  5. Vesselin Obreshkov
    Vesselin Obreshkov avatar
    81 posts
    Member since:
    Jan 2010

    Posted 23 Jul 2012 Link to this post

    I'm not quite sure what questions you are asking of?
  6. hn
    hn avatar
    1 posts
    Member since:
    Mar 2007

    Posted 23 Jul 2012 Link to this post

    Hi
    Thanks for replying
    Basically, we have several uploaders whose select and upload events point to a single handler. Within the handler we want establish which uploader fired the event.

    The 2nd thing is that if we place an uploader in a div for example, how do we access the div (i.e. the uploaders parent container). We tried everything including closest, parent, parents etc etc and all return null

    Many thanks for your time
  7. Vesselin Obreshkov
    Vesselin Obreshkov avatar
    81 posts
    Member since:
    Jan 2010

    Posted 23 Jul 2012 Link to this post

    It's kind of difficult to figure out your problem from your description without seeing your codes in question. If you can post some example or a zipped project that I or someone else can look at, we can probably be able to help you out better.
  8. hn
    hn avatar
    1 posts
    Member since:
    Mar 2007

    Posted 23 Jul 2012 Link to this post

    Many thanks for your reply
    At the moment I cant send you any samples but I will try to explain with the following

    <div id="parentContainer">
     @(Html.Kendo().Upload()
                        .Name("Uploader1")
                       .Async(async => async
                    .Save("Some Method", "Some Controller"))
                        .Events(events => events
                        .Select("uploaderSelect")
                        .Success("uploaderSuccess")
                        .Upload("onUploadMain")
                        .Complete("onComplete")
                    )
            )


    @(Html.Kendo().Upload()
                        .Name("Uploader2")
                       .Async(async => async
                    .Save("Some Method", "Some Controller"))
                        .Events(events => events
                        .Select("uploaderSelect")
                        .Success("uploaderSuccess")
                        .Upload("onUploadMain")
                        .Complete("onComplete")
                    )
            )


    </div>

    then in my events handler

    function uploaderSelect(){
    var id = need code to get the ID of the Uploader that fired this event either Uploader1 or 2
    var parent = need code to get the ID of the Parent Container

    }


    Many thanks
  9. Answer
    Vesselin Obreshkov
    Vesselin Obreshkov avatar
    81 posts
    Member since:
    Jan 2010

    Posted 23 Jul 2012 Link to this post

    You need to update your event callbacks to accept an argument for the event sent by the control like such:

    function uploaderSelect(e){
        var sender = e.sender.element;
    }

    This will give you a reference to the upload control that triggered the event and it's name, id, etc. As for getting to the parent, you will need to provide a more complete example. Here you have a single parent div with an ID...
  10. hn
    hn avatar
    1 posts
    Member since:
    Mar 2007

    Posted 23 Jul 2012 Link to this post

    YOU ARE BRILLIANT - as a result of your answer, my second problem is also solved.
    If my site makes millions (who knows!), I wont forget your contribution.
    Many thanks
  11. Vesselin Obreshkov
    Vesselin Obreshkov avatar
    81 posts
    Member since:
    Jan 2010

    Posted 23 Jul 2012 Link to this post

    I'll just take 50% ownership, thank you ;)



    Glad I can help.
Back to Top
UI for ASP.NET MVC is VS 2017 Ready