Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

472
Vistas
Set kendo DataSource without calling read()

Is it possible to set the DataSource of a Kendo ListView without having the DataSource then call the read() method?

I have a main DataSource that I am using on a ListView and all of the child ListViews but am just filtering it for each ListView depending on a few conditions. The way that I'm doing this is once all of the data has been bound to the main ListView then I create all of the child ListViews and assign the same datasource with filtering.

The issue I'm having here is once I assign the filtered DataSource to the new ListView it seems to be calling the read method again.

baSurveyGroupTemplateDataSource: new kendo.data.DataSource({
    transport: {
        read: {
            async: false,
            url: "/Url/to/data"
            dataType: "json",
            type: "GET",
            data: {
                id: $("#TemplateId").val()
            },
        }
    }
}),             
groupDataBound: function (e) {
    $(".childBaSuveyGroupTemplate").each(function () {
        viewModel.seedGroup(this);
    });
},
seedGroup: function (parentGroup) {
    var childrenGroupList = $(parentGroup);
    var parentGroupId = childrenGroupList.data("id");
    var childrenGroupDataSource = new kendo.data.DataSource(viewModel.baSurveyGroupTemplateDataSource);
    childrenGroupDataSource.query({
        filter: ({ field: "BaSurveyGroupTemplateParentId", operator: "eq", value: parentGroupId })
    });
    childrenGroupList.kendoListView({
        template: kendo.template($("#baSurveyGroupTemplateDisplayTemplate").html()),
        dataSource: childrenGroupDataSource
    });
}

Let me know if I need to clarify anything. It's hard to try and put what I'm doing and the problem I'm having into words.

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Try adding this to your ListView configuration:

autoBind: false

From the kendo documentation at http://docs.telerik.com/kendo-ui/api/javascript/ui/listview#configuration-autoBind

If set to false the widget will not bind to the data source during initialization. In this case data binding will occur when the change event of the data source is fired. By default the widget will bind to the data source specified in the configuration.

Setting autoBind to false is useful when multiple widgets are bound to the same data source. Disabling automatic binding ensures that the shared data source does not make more than one request to the remote service.

Then manually trigger the datasource read once you have everything set:

childrenGroupDataSource.read();  // "read()" will fire the "change" event of the dataSource and the widget will be bound
about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda