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

[Solved] Grid issues with remote filtering

2 Answers 120 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Onlineprinters
Top achievements
Rank 1
Onlineprinters asked on 26 Mar 2015, 11:23 AM
I get errors when i try to use a dataSource for multi checkbox:

Works:
filterable: {
    multi: true,
    dataSource: new kendo.data.DataSource({
        transport: {
            read: {
                url: Routing.generate('some_url'),
                dataType: 'json'
            }
        }
    })
}

Doesn't work:
filterable: {
    multi: true,
    dataSource: {
        transport: {
            read: {
                url: Routing.generate('some_url'),
                dataType: 'json'
            }
        }
    }
}

Console output:
"Uncaught TypeError: Cannot read property 'model' of undefined"

With the working snippet i have another problem:
The multi checkbox filter is correctly filled with values from the given URL, but if i click on button "Filter" nothing happens. There's no error, it just doesn't fire up the main request of the grid.

The gridconfig (model and columns are strongly reduced):
var productModel = kendo.data.Model.define({
    id: 'id',
    fields: {
        'someField': {type: 'string'}
    }
});
var productColumns = [
    {field: "someField", title: "some field",
        filterable: {
            multi: true,
            dataSource: {
                transport: {
                    read: {
                        url: Routing.generate('some_url'),
                        dataType: 'json'
                    }
                }
            }
        }
    }
];
$scope.mainGridOptions = {
    columnMenu: true,
    columns: productColumns,
    dataSource: {
        transport: {
            read: {
                url: Routing.generate('get_products'),
                dataType: 'json',
                cache: false
            }
        },
        pageSize: 50,
        serverPaging: true,
        serverFiltering: true,
        serverSorting: true,
        schema: {
            total: 'total',
            data: 'data',
            model: productModel
        }
    },
    /*filterable: {
        extra: false,
        mode: "menu, row"
    },*/
    filterable: true,
    groupable: false,
    height: $('.product-index-grid').height(),
    pageable: {
        pageSizes: [25, 50, 100, 250],
        buttonCount: 5,
        refresh: true
    },
    reorderable: true,
    resizable: true,
    scrollable: true,
    sortable: true
};

Any help would be great!

2 Answers, 1 is accepted

Sort by
0
Accepted
Petur Subev
Telerik team
answered on 30 Mar 2015, 10:26 AM
Hello Fabian,

We recently fixed an issue that was throwing a similar exception. Please update to the latest internal build version and let us know if you still experience such issue.

My apologies for any inconvenience caused.

Kind Regards,
Petur Subev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Onlineprinters
Top achievements
Rank 1
answered on 01 Apr 2015, 12:03 PM
Thanks for your help, works like a charm, with version 2015.1.327
Tags
Grid
Asked by
Onlineprinters
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Onlineprinters
Top achievements
Rank 1
Share this question
or