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

One js file nearly 500K !

9 Answers 197 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
hn
Top achievements
Rank 1
hn asked on 16 Jul 2012, 11:57 PM
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

9 Answers, 1 is accepted

Sort by
0
Vesselin Obreshkov
Top achievements
Rank 2
answered on 20 Jul 2012, 05:38 PM
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 
0
hn
Top achievements
Rank 1
answered on 21 Jul 2012, 02:47 PM
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 ?
0
Vesselin Obreshkov
Top achievements
Rank 2
answered on 23 Jul 2012, 04:41 PM
I'm not quite sure what questions you are asking of?
0
hn
Top achievements
Rank 1
answered on 23 Jul 2012, 06:46 PM
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
0
Vesselin Obreshkov
Top achievements
Rank 2
answered on 23 Jul 2012, 07:15 PM
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.
0
hn
Top achievements
Rank 1
answered on 23 Jul 2012, 08:01 PM
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
0
Accepted
Vesselin Obreshkov
Top achievements
Rank 2
answered on 23 Jul 2012, 08:51 PM
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...
0
hn
Top achievements
Rank 1
answered on 23 Jul 2012, 11:18 PM
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
0
Vesselin Obreshkov
Top achievements
Rank 2
answered on 24 Jul 2012, 02:03 AM
I'll just take 50% ownership, thank you ;)



Glad I can help.
Tags
General Discussions
Asked by
hn
Top achievements
Rank 1
Answers by
Vesselin Obreshkov
Top achievements
Rank 2
hn
Top achievements
Rank 1
Share this question
or