New row at top not working

Posted by: waheedahmed.hyder on 7 May 2018, 8:54 pm EST

    • Post Options:
    • Link

    Posted 7 May 2018, 8:54 pm EST

    Hi,

    As per my implementation I have to add rows using modal popup and the new row template should be on top always

    I tried like this

    grid.beginUpdate();

    var item = grid.collectionView.addNew();

    item.name = ‘test data’;

    grid.collectionView.commitNew();

    grid.endUpdate();

    even though I have added new-row-at-top=“true” on grid but still the new row is getting to bottom after adding the row using above code.

    thanks,

    Waheed

  • Posted 9 May 2018, 12:57 am EST

    Hi,

    The behavior observed is by design. The FlexGrid newRowAtTop property only show the new row template on top. But it adds data to the end of array.

    You may add newly added row data to any position in SourceCollection array using Array methods.

    Please refer to following sample which inserts new row at top using modal popup.

    https://stackblitz.com/edit/js-9cffra?file=index.js

    ~Manish

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels