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

autobind: false still reads on pageload

4 Answers 1130 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 02 Aug 2012, 04:07 PM
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?

4 Answers, 1 is accepted

Sort by
0
Florian
Top achievements
Rank 1
answered on 24 Aug 2012, 10:13 AM
David, did you find a solution or a workaround?
I can confirm it is not working!

Regards
Florian
0
David
Top achievements
Rank 1
answered on 27 Aug 2012, 08:52 PM
I did not find a solution. My workaround is to supply initial parameters that give an empty but valid response to the initial reads.
0
Accepted
Joe
Top achievements
Rank 1
answered on 22 Sep 2012, 04:38 AM
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
0
Kwex
Top achievements
Rank 1
answered on 07 Oct 2012, 10:31 PM
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
});
Tags
Data Source
Asked by
David
Top achievements
Rank 1
Answers by
Florian
Top achievements
Rank 1
David
Top achievements
Rank 1
Joe
Top achievements
Rank 1
Kwex
Top achievements
Rank 1
Share this question
or