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

OData expand and filterable mode row

5 Answers 333 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bill
Top achievements
Rank 2
Bill asked on 23 Sep 2014, 09:46 PM
I have a complex view that works well when I set the datasource filterable.mode to 'menu'.  When I set it to 'row', it throws an error in kendo.all.js line 2503, "Unexpected token }".  Version is v2014.2.801.  I strongly suspect it has something to do with my use of the OData expand convention, as I have multiple other grids and OData datasources that work well with filterable mode set to row, but they don't use the expand option.


             ... new kendo.data.DataSource({
                        type: 'odata',
                        transport: {
                            read: {
                                async: false,
                                url: '../odata/UserRole',
                                dataType: 'json',
                                data: {
                                    $expand: "User,Role/Application"
                                }
                            },
                       },    

My grid shows 1 column each from the User, Role and Role.Application objects returned.  Just switching to mode: 'menu' fixes everything, except that I can't use the column level filterable cell objects, as they are only compatible with mode: 'row'. 

Is this a known issue or unsupported feature?
Can you create a simple grid using OData expand and filterable mode: row? 


5 Answers, 1 is accepted

Sort by
0
Bill
Top achievements
Rank 2
answered on 23 Sep 2014, 10:50 PM
I've also noticed that just adding an expand doesn't break it, but as soon as you use a column from the referenced expand query, that causes the break, e.g., columns: [ { field: 'Role.RoleName',  ...
0
Rosen
Telerik team
answered on 25 Sep 2014, 02:42 PM
Hi Bill,

I'm afraid that I'm unable to observe such behavior locally using the provided details. Please take a look at this test page which tries to recreate the described scenario, maybe I'm missing something obvious.

Regards,
Rosen
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bill
Top achievements
Rank 2
answered on 25 Sep 2014, 08:28 PM
Its the file version, but I've found a few other things which are likely bugs.

You can replicate the issue simply by changing the version from Kendo 2014 Q2 SP1 to Kendo 2014 Q2.

However, I've discovered a few more issues when making a demo for you that more closely resembled the relationship I was trying to display with the expand.  I can create a new forum post for this if you like.

Using my link, http://dojo.telerik.com/umAK, which more closely represents the relationship I was modeling, you will notice two issues.  1: I can't seem to get the column of a referenced entity to format as a date.  Tried a few things and failed as you can see in schema model.  2: The filterable cell on the Company Name only brings back one entry even if I type in a vowel, like 'e', which should bring back quite a few more.        




0
Accepted
Rosen
Telerik team
answered on 26 Sep 2014, 08:59 AM
Hello Bill,

I have looked that the test page you have provided.

The date is not converted as the schema model definition does no support nested objects. In order to format the data you will need to "flatten" the record by projecting the nested field into new one via the from option.
Regarding the other issue. Indeed, you are correct. However, we were able to address it and the fix will be included in the next internal build. Note that flattening this field will also address it issue. 

Here is an updated version of the sample with suggested changes applied.

Regards,
Rosen
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bill
Top achievements
Rank 2
answered on 26 Sep 2014, 03:21 PM
Great work Rosen, everything is resolved.

For anyone reading this, the immediate issue was resolved by upgrading the kendo js libraries, currently on 2014.2.923.  For the other issues, you can flatten the schema using the 'from' keyword.  Don't forget to change your column names to the flattened version. 
Tags
Grid
Asked by
Bill
Top achievements
Rank 2
Answers by
Bill
Top achievements
Rank 2
Rosen
Telerik team
Share this question
or