Grid Is Not Working Properly

8 posts, 0 answers
  1. Omar
    Omar avatar
    8 posts
    Member since:
    Oct 2012

    Posted 08 Oct 2012 Link to this post

    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
  2. OnaBai
    OnaBai avatar
    55 posts
    Member since:
    Aug 2012

    Posted 08 Oct 2012 Link to this post

    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)
  3. Kendo UI is VS 2017 Ready
  4. Omar
    Omar avatar
    8 posts
    Member since:
    Oct 2012

    Posted 09 Oct 2012 Link to this post

    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
  5. OnaBai
    OnaBai avatar
    55 posts
    Member since:
    Aug 2012

    Posted 09 Oct 2012 Link to this post

    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"?
  6. Omar
    Omar avatar
    8 posts
    Member since:
    Oct 2012

    Posted 09 Oct 2012 Link to this post

    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.
  7. Richard
    Richard avatar
    5 posts
    Member since:
    May 2013

    Posted 05 Dec 2013 Link to this post

    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!
  8. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 10 Dec 2013 Link to this post

    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!
  9. Richard
    Richard avatar
    5 posts
    Member since:
    May 2013

    Posted 28 Jan 2014 in reply to Alexander Valchev Link to this post

    Thanks, fixed it.
Back to Top
Kendo UI is VS 2017 Ready