Deleting Rows from ShinobiDataGrid


I see in the new version of ShinobiPlay that there is a sample grid where users can delete rows. The data object for SDataGridDataSourceHelperDelegateis not mutable (NSArray) so I am having trouble deleting rows on select. Any suggestions?


Hi Asutka,

One way you can remove rows from your ShinobiDataGrid is by removing the data linked to the row from your SDataGridDataSource. Then you can reload your grid and it will render with those rows removed. You can reload your grid using the “reload” method and here is an example of what your code would look like: 

-(void) removeSelectedObjects {
    NSMutableArray *mutableDataArray = [ mutableCopy];
    for(int i = 0;i<_dataSourceHelper.selectedItems.count;i++){
        [mutableDataArray removeObject:_dataSourceHelper.selectedItems[i]];
    } = [NSArray arrayWithArray:mutableDataArray];
    [_grid reload];

Where you would fire the “removeSelectedObjects” method when you want to remove the selected rows.

Kind Regards,
Andrew Polkinghorn


Hi Andrew,

When calling [_grid reload], the grid sometimes sroll up & down awkwardly. Do you have any idea? I am using Version: 2.0.0, released on Apr 26 2013.

Thank you. 

Binh Nguyen