Kendo ui 加载剑道UI网格的图标

Kendo ui 加载剑道UI网格的图标,kendo-ui,kendo-grid,Kendo Ui,Kendo Grid,我是KendoUI的新手,我对加载数据时应该出现的进度图像有一些问题 这是我的HTML: <div> <article > <h5>Anagrafica</h5> </article> <div id="gridRolesT" class="dcmo_grid" kendo-grid="gridRoles" k-options="vm.gridOption

我是KendoUI的新手,我对加载数据时应该出现的进度图像有一些问题

这是我的HTML:

<div>
    <article >
        <h5>Anagrafica</h5>
    </article>
    <div id="gridRolesT" class="dcmo_grid"
         kendo-grid="gridRoles"
         k-options="vm.gridOptions"
         k-on-change="vm.onSelection(kendoEvent)">
    </div>
</div>
控制器:

constructor(private $scope) {
        super($scope);

        $scope.vm = this;

        $("#gridRolesT").kendoGrid();

        this.GetRoles();

    }

 gridOptions = {
        dataSource: new kendo.data.DataSource(
            {
                pageSize: 5
            })
        ,
        columns: [
            { field: 'IdRole', title: 'Role' },
            { field: 'DsRole', title: 'Description' }
        ],
        pageable: {
            pageSizes: true
        },
        filterable: true,
        sortable: true,
        selectable: "row",
        scrollable: false
}

public GetRoles() {
        var self = this;

        kendo.ui.progress($("#gridRolesT"), true);
        this.AppController.AdministrationService.GetRoles()
            .success(function (data) {
                self.populateRole(data);
               kendo.ui.progress($("#gridRolesT"), false);
            })
            .error(function (data) {
               kendo.ui.progress($("#gridRolesT"), false);
                self.ErrorMessage = "Errore caricamento dati";
            });
    }   
我在web上发现,为了在加载数据时显示进度图标,我必须使用kendo.ui.progress($(“#gridID”),但在我的情况下它不起作用

我还试图改变我的网格容器的位置(正如在网络上的一些帖子中所建议的),但我没有得到任何结果

你们有谁能给我一个建议吗

先谢谢你


黛比

我以前使用过下面的代码在剑道网格上切换加载图标

Shows loading image
$('#myGrid').data('kendoGrid')._progress(1);

我发现了问题

我在我的类的构造函数中安装了剑道网格,如下所示:

constructor(private $scope) {
        super($scope);

        $scope.vm = this;

        $("#gridRolesT").kendoGrid();

        this.GetRoles();

    }
从构造函数中删除声明,并保留方法
kendo.ui.progress($(namelement),state)
,如上面的帖子所示,一切正常

非常感谢你的帮助


黛比

在装载足够的情况下,你想展示一个ProPress还是一个纺车?如果是,请检查其他问题/答案纺车正是我想要的。我不知道如何应用您的建议,因为在我的dataSource中,gridOption中仅声明为new kendo.data.dataSource,但数据的实际加载是在populateRole方法中完成的,如上所示:“public populateRole(data){var dataSource=new kendo.data.dataSource({data:data});dataSource.read();this.gridOptions.dataSource.data(dataSource.data());}我怎样才能在这个案例中应用我们的建议?让我看看我是怎么理解的,因为我觉得这很复杂。你正在创建一个伪造的数据源,然后在调用<代码> GETBuffs<代码>的时候,你实际上是在创建好的数据源。正确吗?你是否考虑在<代码>中设置<代码> AutoBud<代码> > <代码> false >代码>?网格definition,因此在数据源上调用
read
之前它不会加载任何内容?你想在剑道网格中显示图像吗?@OneBai:它不是假的数据源。我在gridOption中对网格的数据源进行了意大利化,然后在GetRoles方法中继续加载数据,并将加载的数据附加到t使用命令'this.gridOptions.DataSource.data(DataSource.data())'创建网格的数据源。我尝试使用'autobind=false',但一切都变了。谢谢Jonathan;我尝试了你的建议,但没有成功!:(
Hides loading image
$('#myGrid').data('kendoGrid')._progress(0);
constructor(private $scope) {
        super($scope);

        $scope.vm = this;

        $("#gridRolesT").kendoGrid();

        this.GetRoles();

    }