Inline creating row when data is sorted problem

9 posts, 0 answers
  1. Andy
    Andy avatar
    22 posts
    Member since:
    Feb 2016

    Posted 12 Apr 2016 Link to this post

    I have a grid that uses inline editing. There are also many pages of data, and I noticed that if I sort by any column, then click the "Add new record" button, I don't see the new row appear (I assume it is created at the end of the last page). However when I go to the last page, the row is already created, except it is all blank! I have some required fields that the user needs to fill in before creating the row, but in this situation, the row is created by itself without any values. This blank row only appears on the frontend (doesn't do anything serverside), and clicking "Update" then "Cancel" removes the row from the table...

    Preferably, I would like to be able to jump to the page that contains the created row so that the user doesn't have to go looking for a blank row if they try inserting while the grid is sorted.

    Thanks

     

  2. Andy
    Andy avatar
    22 posts
    Member since:
    Feb 2016

    Posted 13 Apr 2016 in reply to Andy Link to this post

    http://dojo.telerik.com/Aveze

    Here is a sample replicating the issue, if you sort the first column in descending order (click the column header twice) and try to add a row, it will be on the last page. When you go to the last page, the row is already "created" (not in edit mode)

  3. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    2008 posts

    Posted 14 Apr 2016 Link to this post

    Hello Andy,

    I am afraid that this is expected behavior which is due to the way the new records' creation is handled. The "Add new record" in the KendoUI Grid inserts the new item before the first record from the current page position in the original (without sort, page, filtering etc. applied) data. When sorting is applied this new item's position may not match the current page - thus it may be not visible.

    Regarding the required fields -  it is only UI validation and when the item is not on opened for edit the validation will not be triggered.  

    I am afraid currently I can not suggest any suitable workaround to handle the right position of the newly inserted item.

     

    Regards,
    Boyan Dimitrov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  4. Andy
    Andy avatar
    22 posts
    Member since:
    Feb 2016

    Posted 14 Apr 2016 in reply to Boyan Dimitrov Link to this post

    Is there a way to clear all sorting/filters on "Insert new record" click?
  5. Andy
    Andy avatar
    22 posts
    Member since:
    Feb 2016

    Posted 14 Apr 2016 in reply to Andy Link to this post

    // clear filters/sort if the user wants to add a row
    $(document).on("mouseup",'a.k-button.k-button-icontext.k-grid-add',function () {
          $("form.k-filter-menu button[type='reset']").trigger('click');
          $("#gridName").data("kendoGrid").dataSource.sort({});
    });

     

    Found a decent workaround, this removes all sorting and filters from the grid when you release the mouse button on "Add new record", and then you will be able to see the new row.

  6. Matt
    Matt avatar
    2 posts
    Member since:
    Sep 2017

    Posted 02 Nov 2017 Link to this post

    I think this behaviour is illogical and not user friendly. The workaround is OK, but I don't think users should have to have their sorting reset when adding a new record.

    Why shouldn't it be on the top row, where you'd expect it?

    If someone creates a new entry, who would expect to navigate to another page before they can set the attributes?!! By that time, the row is no longer editable and fields say 'not defined'.

    Definitely not professional.

  7. Stefan
    Admin
    Stefan avatar
    1938 posts

    Posted 06 Nov 2017 Link to this post

    Hello, Matt,

    Thank you for the feedback.

    I will forward this to the developers' team to check if we can make changes to the Grid Add new records behavior in order to take the current sorting criteria into account.

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  8. David
    David avatar
    2 posts
    Member since:
    Apr 2014

    Posted 09 Apr in reply to Stefan Link to this post

    Has there been an update to this issue?
  9. Stefan
    Admin
    Stefan avatar
    1938 posts

    Posted 10 Apr Link to this post

    Hello, David,

    Currently, the behavior is not changed as changing it will cause a breaking change in the widget.

    I can agree that this may be strange behavior, but it is required in the current implementation.

    I can suggest submitting a feature request and based on the community feedback we may implement it in a future release:

    http://kendoui-feedback.telerik.com/forums/127393-telerik-kendo-ui-feedback?category_id=170280

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top