Setting DataSource Button Click

2 posts, 0 answers
  1. Scott
    Scott avatar
    6 posts
    Member since:
    Dec 2011

    Posted 25 Nov 2013 Link to this post


    I'm getting no where with trying to get this to work.

    I need to be able to fill a ScrollView widget with images after the click of a button or some other event - not on the load of the page. 

    So, my user logs in and upon login verification the widget is shown and filled with the user's images. I can not get the widget to display any images. Right now I am using a local JSON object for data but there will be a remote call to get the JSON object. (I have confirmed the JSON object works if the dataSource and widget is set up and initialized on page load like the DataBinding example for the ScrollView.)

    I need to hook up the following dataSource to a Scroll View on a button click and I need to be able to update the data source and the scroll view on another button click:

    var _ds = new{
                data: mzData,
                serverPaging: true,
                pageSize: 36,
                schema: {
                    data: "images.image",
                    total: "images.count"

    Here's a sample of my JSON:

    var mzData = {
        "images": {
            "count": 101,
           " image": [
                    "thumbnail": "",
                    "width": 1024,
                    "height": 768,
                    uri: ""
                   "thumbnail": "",
                    "width": 1024,
                    "height": 768,
                    uri: ""

    I have tried several different things including:

     var mz1 = $("#mzScrollView").data("kendoMobileScrollView");

    $("#mzScrollView").kendoMobileScrollView({ dataSource: _ds });
    $("#mzScrollView").kendoMobileScrollView({ dataSource: });

    Nothing works.

    Can you please tell me how to hook up a Scroll View widget to a remote data source and display the data on an event like a button click? Also, I need to know how to update the same widget with other remote data. For example, I will show images in the widget that are public and with the click of another button I will show images that are private.

  2. Petyo
    Petyo avatar
    2444 posts

    Posted 27 Nov 2013 Link to this post

    Hello Scott,

    from what I see, you have opened a support ticket regarding the same topic. This is not necessary in general, since we monitor the premium forums with the same priority as the support requests. For your convenience, I am providing the answer here, too. 

    You can use the autoBind configuration of the ScrollView widget. Please take a look at this sample - the scrollview gets populated when the button is clicked.

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top