autobind: false still reads on pageload

5 posts, 1 answers
  1. David
    David avatar
    32 posts
    Member since:
    May 2012

    Posted 02 Aug 2012 Link to this post

    I've got several dataSources on a page. I want one of the dataSources to read on page load, while the others should only read when I tell them to:

    var aDataSource = new kendo.data.DataSource({yaddayaddayadda});
    var bDataSource = new kendo.data.DataSource({yaddayaddayadda});
    var cDataSource = new kendo.data.DataSource({yaddayaddayadda});
     
    function readDataSources() {
    bDataSource.read();
    cDataSource.read();
    };
      
    $(document).ready(function () {
        $("#aGrid").kendoGrid({
            dataSource: aDataSource,
            autobind: true
        });
        $("#bGrid").kendoGrid({
            dataSource: bDataSource,
            autobind: false
        });
        $("#cGrid").kendoGrid({
            dataSource: cDataSource,
            autobind: false
        });
    })

    When the page loads all dataSources read. What am I doing wrong?
  2. Florian
    Florian avatar
    1 posts
    Member since:
    Aug 2012

    Posted 24 Aug 2012 Link to this post

    David, did you find a solution or a workaround?
    I can confirm it is not working!

    Regards
    Florian
  3. David
    David avatar
    32 posts
    Member since:
    May 2012

    Posted 27 Aug 2012 Link to this post

    I did not find a solution. My workaround is to supply initial parameters that give an empty but valid response to the initial reads.
  4. Answer
    Joe
    Joe avatar
    1 posts
    Member since:
    Sep 2012

    Posted 21 Sep 2012 Link to this post

    David,
               There is a small case sensitive issue i guess. You will have to give autoBind: false not autobind: false. Hope this helps.

    Regards
    Joe John
  5. Kwex
    Kwex avatar
    2 posts
    Member since:
    Jan 2012

    Posted 07 Oct 2012 Link to this post

    Ensure you have an optionLabel set in the config for your dropdown-list. Had the same problem and resolved it by doing so.

    E.g.

    $("#products").kendoDropDownList({
        dataSource: new kendo.data.DataSource({
            transport: {
                read: "data/products.php",
                parameterMap: function(options, operation) {
                    return {
                        CategoryID: options.filter.filters[0].value
                    }
                }
            },
            schema: {
                data: "data"
            },
            serverFiltering: true
        }),
        optionLabel: "Select A Product",
        dataTextField: "ProductName",
        dataValueField: "ProductID",
        cascadeFrom: "categories",
        autoBind: false
    });
Back to Top