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

Grid Is Not Working Properly

7 Answers 1547 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Omar
Top achievements
Rank 1
Omar asked on 08 Oct 2012, 02:08 PM
Hello KendoUI Team,

recently as I have discovered KendoUI and I was very impressed and really prefer over other frameworks like dojo, prototype!

Now, I have a small project which I a couple of issues with
  1. reading of the note.json file seems to be OK
  2. note.json contains 7 items but the paging shows "No items to display"
  3. the create, update and delete functions are working fine but there is no changes visible on the note.json file after a creation, deletion or update.
please find the whole file attached.

I have searched the KendoUI Forums including the web but could not find any help on this.

Please help create my first app with KendoUI!

Thanks
Omar

7 Answers, 1 is accepted

Sort by
0
OnaBai
Top achievements
Rank 2
answered on 08 Oct 2012, 08:33 PM
The JSON document does not include a field called "count". Either you define count or you define total in the schema as:
schema:{
    data :"data",
    total: function(response) {
        return response.data.length;
    },
    model:{
        id    :"NoteId",
        fields:{
            NoteDate:{type:"date", format:"0:dd/MM/yyyy"},
            NoteText:{type:"string", validation:{required:true}}
        } // end of fields
    } // end of model
 
} // end of schema
By the way, there is a spelling error in validation (you typed valdation)
0
Omar
Top achievements
Rank 1
answered on 09 Oct 2012, 11:27 AM
Hello OnaBai,

thank you for your reply.

Unfortunately, your reply does not answer all off my questions.

The snippet you've given me results this statement at the paging area: "NaN - NaN of 7 items"

I've also asked about the CRUD function. I am not able to modify the json file via create, update or delete function of kendoGrid.
Is this not possible? Would you be able to help with this?

Thanks a lot in advanced!
Omar
0
OnaBai
Top achievements
Rank 2
answered on 09 Oct 2012, 11:55 AM
Hi Omar,

Let me take a look into NaN - NaN of 7!
What do you exactly mean by "I am not able to modify the json file via create, update or delete function of kendoGrid"?
0
Omar
Top achievements
Rank 1
answered on 09 Oct 2012, 01:35 PM
Hi OnaBai,

the issue with NaN - NaN of 7 is solved, by mistake I've placed pageSize outside the dataSource object!

In case of modification I mean being able to make changes on the note.json file using CRUD functions, e.g:

NoteId | NoteDate | NoteText
1 | 10/10/2012 | Test note.

If I press the edit button to update NoteText to 
This is an update.

the old note "Test note." appear on reload of the page!
So no changes/updates are taken to the note.json file.

I would be able to do like this example http://demos.kendoui.com/web/grid/editing-popup.html

I hope this now more explainable!

Thanks a lot.
Omar.
0
Richard
Top achievements
Rank 1
answered on 05 Dec 2013, 01:48 PM
I too have getting the NaN - NaN of 5 items.

It's getting the 5 from the total, which I've verified it's returning properly.

I've set the page size on both the grid and the data source as the same size (hoping that it only really need to be set on the grid!) and it doesn't matter.

If I set a filter or order by etc. it displays correctly.

Note this is using Server Paging and Filtering.

Thanks!
0
Alexander Valchev
Telerik team
answered on 10 Dec 2013, 09:55 AM
Hello Richard,

The problem you described is usually connected with the total and/or pageSize properties of the DataSource.
Could you please verify once again that the schema.total points to the correct field from the server response and that the configuration properties are nested at the correct settings level? If this does not help please send me a small but runable jsBin sample which isolates the problem and demonstrates your current implementation.
In this way I will be able to examine your configuration in details and advise you further.

Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Richard
Top achievements
Rank 1
answered on 28 Jan 2014, 03:31 PM
Thanks, fixed it.
Tags
Grid
Asked by
Omar
Top achievements
Rank 1
Answers by
OnaBai
Top achievements
Rank 2
Omar
Top achievements
Rank 1
Richard
Top achievements
Rank 1
Alexander Valchev
Telerik team
Share this question
or